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