mirror of
https://github.com/RocketChat/Rocket.Chat.git
synced 2025-12-27 22:40:49 +00:00
chore!: removes livechat:removeMonitor deprecated method (#37662)
This commit is contained in:
parent
f3f0b273ab
commit
09ba6666a7
5
.changeset/rotten-bees-behave.md
Normal file
5
.changeset/rotten-bees-behave.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@rocket.chat/meteor": patch
|
||||
---
|
||||
|
||||
removes the deprecated meteor method: `livechat:removeMonitor`
|
||||
@ -3,7 +3,6 @@ import { patchOmniCore } from '@rocket.chat/omni-core-ee';
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
|
||||
import './methods/addMonitor';
|
||||
import './methods/removeMonitor';
|
||||
import './methods/saveTag';
|
||||
import './methods/removeBusinessHour';
|
||||
import './hooks/afterTakeInquiry';
|
||||
|
||||
@ -1,29 +0,0 @@
|
||||
import type { ServerMethods } from '@rocket.chat/ddp-client';
|
||||
import { check } from 'meteor/check';
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
|
||||
import { hasPermissionAsync } from '../../../../../app/authorization/server/functions/hasPermission';
|
||||
import { methodDeprecationLogger } from '../../../../../app/lib/server/lib/deprecationWarningLogger';
|
||||
import { LivechatEnterprise } from '../lib/LivechatEnterprise';
|
||||
|
||||
declare module '@rocket.chat/ddp-client' {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
interface ServerMethods {
|
||||
'livechat:removeMonitor'(username: string): boolean;
|
||||
}
|
||||
}
|
||||
|
||||
Meteor.methods<ServerMethods>({
|
||||
async 'livechat:removeMonitor'(username) {
|
||||
methodDeprecationLogger.method('livechat:removeMonitor', '8.0.0', '/v1/livechat/monitors.delete');
|
||||
const uid = Meteor.userId();
|
||||
if (!uid || !(await hasPermissionAsync(uid, 'manage-livechat-monitors'))) {
|
||||
throw new Meteor.Error('error-not-allowed', 'Not allowed', {
|
||||
method: 'livechat:removeMonitor',
|
||||
});
|
||||
}
|
||||
|
||||
check(username, String);
|
||||
return LivechatEnterprise.removeMonitor(username);
|
||||
},
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user