chore!: removes `livechat:saveTag` deprecated method (#37663)

Co-authored-by: Guilherme Gazzo <guilherme@gazzo.xyz>
pull/35380/merge
Lucas Pelegrino 4 weeks ago committed by Guilherme Gazzo
parent 09ba6666a7
commit ee928a66cc
  1. 5
      .changeset/breezy-timers-flow.md
  2. 1
      apps/meteor/ee/app/livechat-enterprise/server/index.ts
  3. 35
      apps/meteor/ee/app/livechat-enterprise/server/methods/saveTag.ts

@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---
Removes the deprecated meteor method: `livechat:saveTag`

@ -3,7 +3,6 @@ import { patchOmniCore } from '@rocket.chat/omni-core-ee';
import { Meteor } from 'meteor/meteor';
import './methods/addMonitor';
import './methods/saveTag';
import './methods/removeBusinessHour';
import './hooks/afterTakeInquiry';
import './hooks/beforeNewInquiry';

@ -1,35 +0,0 @@
import type { ILivechatTag } from '@rocket.chat/core-typings';
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:saveTag'(id: string, tagData: { name: string; description?: string }, tagDepartments: string[]): Promise<ILivechatTag>;
}
}
Meteor.methods<ServerMethods>({
async 'livechat:saveTag'(_id, tagData, tagDepartments) {
methodDeprecationLogger.method('livechat:saveTag', '8.0.0', 'POST /v1/livechat/tags.save');
const uid = Meteor.userId();
if (!uid || !(await hasPermissionAsync(uid, 'manage-livechat-tags'))) {
throw new Meteor.Error('error-not-allowed', 'Not allowed', { method: 'livechat:saveTag' });
}
check(_id, Match.Maybe(String));
check(tagData, {
name: String,
description: Match.Maybe(String),
});
check(tagDepartments, [String]);
return LivechatEnterprise.saveTag(_id, tagData, tagDepartments);
},
});
Loading…
Cancel
Save