Refacor electron app and add migrations
This commit is contained in:
11
electron/cqrs/queries/handlers/getUsersByRoom.ts
Normal file
11
electron/cqrs/queries/handlers/getUsersByRoom.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { DataSource } from 'typeorm';
|
||||
import { UserEntity } from '../../../entities';
|
||||
import { rowToUser } from '../../mappers';
|
||||
|
||||
/** Returns all stored users (room filtering not applicable in this schema). */
|
||||
export async function handleGetUsersByRoom(dataSource: DataSource) {
|
||||
const repo = dataSource.getRepository(UserEntity);
|
||||
const rows = await repo.find();
|
||||
|
||||
return rows.map(rowToUser);
|
||||
}
|
||||
Reference in New Issue
Block a user