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);
}
