10 lines
426 B
TypeScript
10 lines
426 B
TypeScript
import { DataSource } from 'typeorm';
|
|
import { AttachmentEntity } from '../../../entities';
|
|
import { DeleteAttachmentsForMessageCommand } from '../../types';
|
|
|
|
export async function handleDeleteAttachmentsForMessage(command: DeleteAttachmentsForMessageCommand, dataSource: DataSource): Promise<void> {
|
|
const repo = dataSource.getRepository(AttachmentEntity);
|
|
|
|
await repo.delete({ messageId: command.payload.messageId });
|
|
}
|