Whatsapp service updates
This commit is contained in:
parent
e22a8e8d98
commit
3da103c010
16 changed files with 151 additions and 36 deletions
|
|
@ -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();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue