feat(umpires): move umpires between 3 lists by drag-and-drop

This commit is contained in:
2026-05-27 16:54:51 +02:00
parent 03bfc8fc16
commit 71c3733363
10 changed files with 508 additions and 11 deletions
+46
View File
@@ -0,0 +1,46 @@
import { Injectable } from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { db, Settings } from 'db';
import { liveQuery } from 'dexie';
@Injectable({
providedIn: 'root'
})
export class SettingsService {
constructor() {
void this.ensureSettings();
}
/**
* Reactive settings signal
*/
readonly settings = toSignal<Settings | undefined>(
liveQuery(() => db.settings.get(1)),
{ initialValue: undefined }
);
/**
* Update settings
*/
async update(changes: Partial<Omit<Settings, 'id'>>): Promise<void> {
const current = await db.settings.get(1);
if (!current) {
return;
}
await db.settings.update(1, changes);
}
private async ensureSettings() {
const existing = await db.settings.get(1);
if (!existing) {
await db.settings.put({
id: 1,
numberOfCourts: 5,
withServiceJudge: true
});
}
}
}