feat: Add emoji and alot of other fixes
This commit is contained in:
19
electron/cqrs/commands/handlers/saveCustomEmoji.ts
Normal file
19
electron/cqrs/commands/handlers/saveCustomEmoji.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { DataSource } from 'typeorm';
|
||||
import { CustomEmojiEntity } from '../../../entities';
|
||||
import { SaveCustomEmojiCommand } from '../../types';
|
||||
|
||||
export async function handleSaveCustomEmoji(command: SaveCustomEmojiCommand, dataSource: DataSource): Promise<void> {
|
||||
const { emoji } = command.payload;
|
||||
|
||||
await dataSource.getRepository(CustomEmojiEntity).save({
|
||||
id: emoji.id,
|
||||
name: emoji.name,
|
||||
creatorUserId: emoji.creatorUserId,
|
||||
dataUrl: emoji.dataUrl,
|
||||
hash: emoji.hash,
|
||||
mime: emoji.mime,
|
||||
size: emoji.size,
|
||||
createdAt: emoji.createdAt,
|
||||
updatedAt: emoji.updatedAt
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user