fix- staff deletion

This commit is contained in:
2026-01-06 02:02:37 +05:30
parent b45383de33
commit 7a4ea21658
3 changed files with 9 additions and 3 deletions

View File

@@ -15,7 +15,13 @@ const router = Router();
router.post("/", async (req: Request, res: Response): Promise<any> => {
try {
const validatedData = staffCreateSchema.parse(req.body);
const userId = req.user!.id; // from auth middleware
const validatedData = staffCreateSchema.parse({
...req.body,
userId,
});
const newStaff = await storage.createStaff(validatedData);
res.status(200).json(newStaff);
} catch (error) {