diff --git a/.changeset/shaggy-hats-behave.md b/.changeset/shaggy-hats-behave.md new file mode 100644 index 0000000000000..d3b1045c1d4ac --- /dev/null +++ b/.changeset/shaggy-hats-behave.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': major +--- + +Removes deleteCustomSound Meteor method diff --git a/apps/meteor/app/custom-sounds/server/index.ts b/apps/meteor/app/custom-sounds/server/index.ts index 1825fa7e7dc40..47b694d1af313 100644 --- a/apps/meteor/app/custom-sounds/server/index.ts +++ b/apps/meteor/app/custom-sounds/server/index.ts @@ -1,3 +1,2 @@ import './startup/custom-sounds'; -import './methods/deleteCustomSound'; import './methods/listCustomSounds'; diff --git a/apps/meteor/app/custom-sounds/server/methods/deleteCustomSound.ts b/apps/meteor/app/custom-sounds/server/methods/deleteCustomSound.ts deleted file mode 100644 index 5b122fa5e116f..0000000000000 --- a/apps/meteor/app/custom-sounds/server/methods/deleteCustomSound.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { ICustomSound } 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 '../../../authorization/server/functions/hasPermission'; -import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -import { deleteCustomSound } from '../lib/deleteCustomSound'; - -declare module '@rocket.chat/ddp-client' { - // eslint-disable-next-line @typescript-eslint/naming-convention - interface ServerMethods { - deleteCustomSound(_id: ICustomSound['_id']): Promise; - } -} - -Meteor.methods({ - async deleteCustomSound(_id) { - methodDeprecationLogger.method('deleteCustomSound', '9.0.0', '/v1/custom-sounds.delete'); - if (!this.userId || !(await hasPermissionAsync(this.userId, 'manage-sounds'))) { - throw new Meteor.Error('not_authorized'); - } - check(_id, String); - await deleteCustomSound(_id); - return true; - }, -});