This commit is contained in:
Lars committed 2026-07-06 19:08:24 +02:00
1 parent 911dcace72
commit 9c68c414d8
53 files changed
+2919 -469

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
import { getAllRows, getRowById, getRowsWhereIn, insertRow, updateRow, deleteRowById } from '../crud'
import type { Group, Consultant } from '../../../src/db/types'
export const listGroups = (): Group[] => getAllRows<Group>('groups')
export const addGroup = (group: Omit<Group, 'id'>): number => insertRow('groups', group)
export const listConsultants = (): Consultant[] => getAllRows<Consultant>('consultants')
export const getConsultant = (id: number): Consultant | undefined => getRowById<Consultant>('consultants', id)
export const getConsultantsByIds = (ids: number[]): Consultant[] => getRowsWhereIn<Consultant>('consultants', 'id', ids)
export const addConsultant = (consultant: Omit<Consultant, 'id'>): number => insertRow('consultants', consultant)
export const updateConsultant = (id: number, patch: Partial<Consultant>): number => updateRow('consultants', id, patch)
export const deleteConsultant = (id: number): void => deleteRowById('consultants', id)