refactor: split api routes by concern

This commit is contained in:
MythEclipse
2026-05-14 19:46:47 +07:00
parent 3fb1fcb72c
commit c81a499535
7 changed files with 503 additions and 207 deletions

View File

@@ -20,7 +20,7 @@ function sendJson(clients: Set<ClientLike>, event: ModerationWsEvent): void {
} catch (error) {
log.warn(
{ error, eventType: event.type },
"Failed to send event to client"
"Failed to send event to client",
);
}
}
@@ -42,6 +42,9 @@ export function createBroadcaster() {
clientCount() {
return clients.size;
},
getClients() {
return Array.from(clients);
},
uiState(state: unknown) {
sendJson(clients, { type: "ui_state", state });
},