Files
kawai-focus-v2/client/src/db/crud/timerCrud.ts
2026-04-23 22:12:29 +03:00

17 lines
570 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { getDb } from "@/db/initDb";
import { SELECT_TIMERS, SELECT_TIMER } from "@/db/dml/timerDML";
import { TimersRow, TimerRow } from "@/types/timerType";
/** Получает список таймеров */
export async function getTimers(): Promise<TimersRow[]> {
const db = await getDb();
return await db.select<TimersRow[]>(SELECT_TIMERS);
}
/* Получает таймер по его id **/
export async function getTimer(TimerId: number): Promise<TimerRow> {
const db = await getDb();
return await db.select<TimerRow>(SELECT_TIMER, [TimerId]);
}