upd
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import db from "../../db";
|
||||
import { clientsTable } from "../../db/schema";
|
||||
import { eq } from "drizzle-orm";
|
||||
import { status } from "elysia";
|
||||
|
||||
export async function editClient(
|
||||
clientId: string,
|
||||
data: {
|
||||
email: string | null;
|
||||
phone: string;
|
||||
name: string;
|
||||
}
|
||||
) {
|
||||
try {
|
||||
return await db
|
||||
.update(clientsTable)
|
||||
.set(data)
|
||||
.where(eq(clientsTable.id, clientId))
|
||||
.returning();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return status(500, "Internal Server Error");
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,8 @@ async function getClients({
|
||||
manager: { columns: { password: false } },
|
||||
app: true,
|
||||
comments: { with: { manager: { columns: { password: false } } } },
|
||||
server: true,
|
||||
client: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -50,7 +50,6 @@ async function getSessions(
|
||||
manager: {
|
||||
columns: {
|
||||
password: false,
|
||||
fullname: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user