Skip to content

Commit

Permalink
moving value parsing to try catch
Browse files Browse the repository at this point in the history
  • Loading branch information
LordFarquaadtheCreator committed Jun 19, 2024
1 parent afbd8db commit b55201f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routes/projectsDB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ async function startServer() {
});

router.post("/add", validate, async (req: any, res: any) => {
const values: Array<any> = Object.values(req.body);
const query = `
INSERT INTO projects (name, "short-desc", "long-desc", team, link, image, "tech-stack", cohort, topic)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)`;
try {
const values: Array<any> = Object.values(req.body);
await queryDatabase(client, query, values);
await synchronizeLocal(client);
return res.status(200).json({ message: "Project added successfully" });
Expand Down

0 comments on commit b55201f

Please sign in to comment.