Refacor electron app and add migrations
This commit is contained in:
10
electron/cqrs/queries/handlers/getAllAttachments.ts
Normal file
10
electron/cqrs/queries/handlers/getAllAttachments.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { DataSource } from 'typeorm';
|
||||
import { AttachmentEntity } from '../../../entities';
|
||||
import { rowToAttachment } from '../../mappers';
|
||||
|
||||
export async function handleGetAllAttachments(dataSource: DataSource) {
|
||||
const repo = dataSource.getRepository(AttachmentEntity);
|
||||
const rows = await repo.find();
|
||||
|
||||
return rows.map(rowToAttachment);
|
||||
}
|
||||
Reference in New Issue
Block a user