From ce448826ef295d9a58d6e2d8015defb48527f3d9 Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Tue, 25 Jun 2024 01:23:57 +0530 Subject: [PATCH] refactor!: removed listEmojiCustom method (#32542) --- apps/meteor/app/emoji-custom/server/index.ts | 1 - .../server/methods/listEmojiCustom.ts | 35 ------------------- 2 files changed, 36 deletions(-) delete mode 100644 apps/meteor/app/emoji-custom/server/methods/listEmojiCustom.ts diff --git a/apps/meteor/app/emoji-custom/server/index.ts b/apps/meteor/app/emoji-custom/server/index.ts index 83866b83b5696..3ec2051f8fffb 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 485737b95f9b4..0000000000000 --- 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 { EmojiCustom } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; -import { check, Match } from 'meteor/check'; -import { Meteor } from 'meteor/meteor'; - -import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; - -declare module '@rocket.chat/ui-contexts' { - // 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(); - }, -});