Refacor electron app and add migrations
This commit is contained in:
10
electron/cqrs/commands/handlers/removeReaction.ts
Normal file
10
electron/cqrs/commands/handlers/removeReaction.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { DataSource } from 'typeorm';
|
||||
import { ReactionEntity } from '../../../entities';
|
||||
import { RemoveReactionCommand } from '../../types';
|
||||
|
||||
export async function handleRemoveReaction(command: RemoveReactionCommand, dataSource: DataSource): Promise<void> {
|
||||
const repo = dataSource.getRepository(ReactionEntity);
|
||||
const { messageId, userId, emoji } = command.payload;
|
||||
|
||||
await repo.delete({ messageId, userId, emoji });
|
||||
}
|
||||
Reference in New Issue
Block a user