fix: staff edit error and column order on appointment page

This commit is contained in:
ff
2026-04-12 12:13:57 -04:00
parent 1eac0c313c
commit 805fb3964a
3 changed files with 4 additions and 5 deletions

View File

@@ -49,7 +49,8 @@ router.put("/:id", async (req: Request, res: Response): Promise<any> => {
return res.status(400).send("Invalid staff ID");
}
const validatedData = staffUpdateSchema.parse(req.body);
const { userId: _userId, id: _id, createdAt: _createdAt, ...updateBody } = req.body;
const validatedData = staffUpdateSchema.parse(updateBody);
const updatedStaff = await storage.updateStaff(
parsedStaffId,
validatedData

View File

@@ -19,7 +19,7 @@ export const staffStorage: IStorage = {
},
async getAllStaff(): Promise<Staff[]> {
const staff = await db.staff.findMany();
const staff = await db.staff.findMany({ orderBy: { id: "asc" } });
return staff;
},