This commit is contained in:
2025-06-19 18:36:31 +05:00
parent 971cd8ff8e
commit cd61fc686b
5 changed files with 43 additions and 3 deletions
+24
View File
@@ -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");
}
}
+2
View File
@@ -32,6 +32,8 @@ async function getClients({
manager: { columns: { password: false } },
app: true,
comments: { with: { manager: { columns: { password: false } } } },
server: true,
client: true,
},
},
},
-1
View File
@@ -50,7 +50,6 @@ async function getSessions(
manager: {
columns: {
password: false,
fullname: true,
},
},
},