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