Whatsapp service updates

This commit is contained in:
Darren Clarke 2024-05-16 18:22:10 +02:00
parent e22a8e8d98
commit 3da103c010
16 changed files with 151 additions and 36 deletions

View file

@ -112,3 +112,16 @@ export const deleteAction = async ({ entity, table, id }: DeleteActionArgs) => {
export const selectAllAction = async (table: keyof Database) => {
return db.selectFrom(table).selectAll().execute();
};
type SelectOneArgs = {
table: keyof Database;
id: string;
};
export const selectOneAction = async ({ table, id }: SelectOneArgs) => {
return db
.selectFrom(table)
.selectAll()
.where("id", "=", id)
.executeTakeFirst();
};