feat: Add emoji and alot of other fixes
This commit is contained in:
9
electron/cqrs/queries/handlers/getCustomEmojis.ts
Normal file
9
electron/cqrs/queries/handlers/getCustomEmojis.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { DataSource } from 'typeorm';
|
||||
import { CustomEmojiEntity } from '../../../entities';
|
||||
import { rowToCustomEmoji } from '../../mappers';
|
||||
|
||||
export async function handleGetCustomEmojis(dataSource: DataSource) {
|
||||
const rows = await dataSource.getRepository(CustomEmojiEntity).find({ order: { updatedAt: 'DESC' } });
|
||||
|
||||
return rows.map(rowToCustomEmoji);
|
||||
}
|
||||
@@ -31,6 +31,7 @@ import { handleGetBansForRoom } from './handlers/getBansForRoom';
|
||||
import { handleIsUserBanned } from './handlers/isUserBanned';
|
||||
import { handleGetAttachmentsForMessage } from './handlers/getAttachmentsForMessage';
|
||||
import { handleGetAllAttachments } from './handlers/getAllAttachments';
|
||||
import { handleGetCustomEmojis } from './handlers/getCustomEmojis';
|
||||
import { handleGetPluginData } from './handlers/getPluginData';
|
||||
import { handleGetMeta } from './handlers/getMeta';
|
||||
|
||||
@@ -50,6 +51,7 @@ export const buildQueryHandlers = (dataSource: DataSource): Record<QueryTypeKey,
|
||||
[QueryType.IsUserBanned]: (query) => handleIsUserBanned(query as IsUserBannedQuery, dataSource),
|
||||
[QueryType.GetAttachmentsForMessage]: (query) => handleGetAttachmentsForMessage(query as GetAttachmentsForMessageQuery, dataSource),
|
||||
[QueryType.GetAllAttachments]: () => handleGetAllAttachments(dataSource),
|
||||
[QueryType.GetCustomEmojis]: () => handleGetCustomEmojis(dataSource),
|
||||
[QueryType.GetPluginData]: (query) => handleGetPluginData(query as GetPluginDataQuery, dataSource),
|
||||
[QueryType.GetMeta]: (query) => handleGetMeta(query as GetMetaQuery, dataSource)
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user