mirror of
https://gitea.gofwd.group/dstrawsb/ballistic-builder.git
synced 2025-12-06 10:46:44 -05:00
accounts stuff
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
// db/queries.ts
|
||||
"use server";
|
||||
import { eq, not , asc} from "drizzle-orm";
|
||||
import { Account } from '../schema/Account'
|
||||
import { db } from '../index';
|
||||
|
||||
@@ -14,10 +16,10 @@ export async function addAcount(first_name: string, last_name : string, username
|
||||
|
||||
// Update a account
|
||||
export async function updateAcount(id: number, first_name: string, last_name : string, username : string, password_hash: string ) {
|
||||
return await db.update(Account).set({ first_name, last_name, username, password_hash }).where(Account.id.equals(id));
|
||||
return await db.update(Account).set({ first_name, last_name, username, password_hash }).where(eq(Account.id, id));
|
||||
}
|
||||
|
||||
// Delete a account
|
||||
export async function deleteAccount(id: number) {
|
||||
return await db.delete(Account).where(Account.id.equals(id));
|
||||
return await db.delete(Account).where(eq(Account.id, id));
|
||||
}
|
||||
Reference in New Issue
Block a user