mirror of
https://github.com/RocketChat/Rocket.Chat.git
synced 2025-12-27 22:40:49 +00:00
chore!: removes deprecated method livechat:removeBusinessHour (#37819)
This commit is contained in:
parent
d769c9080a
commit
4c55c57a00
5
.changeset/forty-pears-divide.md
Normal file
5
.changeset/forty-pears-divide.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@rocket.chat/meteor": patch
|
||||
---
|
||||
|
||||
Removes deprecated method `livechat:removeBusinessHour`
|
||||
@ -2,7 +2,6 @@ import { License } from '@rocket.chat/license';
|
||||
import { patchOmniCore } from '@rocket.chat/omni-core-ee';
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
|
||||
import './methods/removeBusinessHour';
|
||||
import './hooks/afterTakeInquiry';
|
||||
import './hooks/beforeNewInquiry';
|
||||
import './hooks/beforeNewRoom';
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
import type { ServerMethods } from '@rocket.chat/ddp-client';
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
|
||||
import { hasPermissionAsync } from '../../../../../app/authorization/server/functions/hasPermission';
|
||||
import { methodDeprecationLogger } from '../../../../../app/lib/server/lib/deprecationWarningLogger';
|
||||
import { businessHourManager } from '../../../../../app/livechat/server/business-hour';
|
||||
|
||||
declare module '@rocket.chat/ddp-client' {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
interface ServerMethods {
|
||||
'livechat:removeBusinessHour'(id: string, type: string): void;
|
||||
}
|
||||
}
|
||||
|
||||
Meteor.methods<ServerMethods>({
|
||||
async 'livechat:removeBusinessHour'(id: string, type: string) {
|
||||
methodDeprecationLogger.method('livechat:removeBusinessHour', '8.0.0', '/v1/livechat/business-hours.remove');
|
||||
const userId = Meteor.userId();
|
||||
|
||||
if (!userId || !(await hasPermissionAsync(userId, 'view-livechat-business-hours'))) {
|
||||
throw new Meteor.Error('error-not-allowed', 'Not allowed', {
|
||||
method: 'livechat:removeBusinessHour',
|
||||
});
|
||||
}
|
||||
|
||||
return businessHourManager.removeBusinessHourByIdAndType(id, type);
|
||||
},
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user