diff --git a/apps/meteor/app/emoji-custom/server/index.ts b/apps/meteor/app/emoji-custom/server/index.ts index 83866b83b569..3ec2051f8fff 100644 --- a/apps/meteor/app/emoji-custom/server/index.ts +++ b/apps/meteor/app/emoji-custom/server/index.ts @@ -1,5 +1,4 @@ import './startup/emoji-custom'; -import './methods/listEmojiCustom'; import './methods/deleteEmojiCustom'; import './methods/insertOrUpdateEmoji'; import './methods/uploadEmojiCustom'; diff --git a/apps/meteor/app/emoji-custom/server/methods/listEmojiCustom.ts b/apps/meteor/app/emoji-custom/server/methods/listEmojiCustom.ts deleted file mode 100644 index a16d536d92d4..000000000000 --- a/apps/meteor/app/emoji-custom/server/methods/listEmojiCustom.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { IEmojiCustom } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ddp-client'; -import { EmojiCustom } from '@rocket.chat/models'; -import { check, Match } from 'meteor/check'; -import { Meteor } from 'meteor/meteor'; - -import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; - -declare module '@rocket.chat/ddp-client' { - // eslint-disable-next-line @typescript-eslint/naming-convention - interface ServerMethods { - listEmojiCustom(options?: { name?: string; aliases?: string[] }): IEmojiCustom[]; - } -} - -Meteor.methods({ - async listEmojiCustom(options = {}) { - methodDeprecationLogger.method('listEmojiCustom', '7.0.0'); - - const user = await Meteor.userAsync(); - - if (!user) { - throw new Meteor.Error('error-invalid-user', 'Invalid user', { - method: 'listEmojiCustom', - }); - } - - check(options, { - name: Match.Optional(String), - aliases: Match.Optional([String]), - }); - - return EmojiCustom.find(options).toArray(); - }, -});