From b06a26ab39ede3cd0327f7e8b742808beb54b14a 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 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(); - }, -});