Adds eslint and linted & improved routing for interactions

This commit is contained in:
Michel Fedde 2025-06-17 20:37:53 +02:00
parent 83209f642c
commit 441715675c
35 changed files with 2091 additions and 463 deletions

View file

@ -59,7 +59,7 @@ export class PlaydateRepository extends Repository<PlaydateModel, DBPlaydate> {
}
getNextPlaydateForGroup(group: GroupModel): PlaydateModel | null {
let sql = `SELECT * FROM ${this.schema.name} WHERE groupid = ? AND time_from > ? ORDER BY time_from ASC LIMIT 1`;
const sql = `SELECT * FROM ${this.schema.name} WHERE groupid = ? AND time_from > ? ORDER BY time_from LIMIT 1`;
const find = this.database.fetch<number, DBPlaydate>(
sql,
@ -78,14 +78,12 @@ export class PlaydateRepository extends Repository<PlaydateModel, DBPlaydate> {
if (!intermediateModel) {
throw new Error("Unable to convert the playdate model");
}
const result: PlaydateModel = {
return {
id: intermediateModel.id,
group: fixedGroup ?? this.groupRepository.getById(intermediateModel.groupid),
from_time: new Date(intermediateModel.time_from),
to_time: new Date(intermediateModel.time_to),
}
return result;
};
}
protected convertToCreateObject(instance: Partial<PlaydateModel>): object {