From 9d625b0fd59c2ab553b7ea37318aa8813e2f3539 Mon Sep 17 00:00:00 2001 From: "HRG @ SCExC" Date: Sun, 12 Jan 2025 10:16:33 -0500 Subject: [PATCH] fix: updte templte fix, json bodyprser --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 81e29d5..5058516 100644 --- a/index.js +++ b/index.js @@ -24,6 +24,7 @@ let eta = new Eta({ views: viewpath, cache: false, autoEscape: true }); let routes = { GET: [], POST: [], PUT: [], DELETE: [] }; app.use(bodyParser.urlencoded({ extended: true })); +app.use(bodyParser.json()); app.use(express.static("public")); app.use(fileUpload()); @@ -487,7 +488,7 @@ app.put("/workshop/:structure_id/template/:template_id", (req, res) => { let test_object = req.body.test_object; model.updateTemplate(db, { - ...model.updateTemplate(db, id), + ...model.getTemplate(db, id), content, test_object, });