fix: updte templte fix, json bodyprser
This commit is contained in:
parent
00d62c5d42
commit
9d625b0fd5
1 changed files with 2 additions and 1 deletions
3
index.js
3
index.js
|
|
@ -24,6 +24,7 @@ let eta = new Eta({ views: viewpath, cache: false, autoEscape: true });
|
||||||
let routes = { GET: [], POST: [], PUT: [], DELETE: [] };
|
let routes = { GET: [], POST: [], PUT: [], DELETE: [] };
|
||||||
|
|
||||||
app.use(bodyParser.urlencoded({ extended: true }));
|
app.use(bodyParser.urlencoded({ extended: true }));
|
||||||
|
app.use(bodyParser.json());
|
||||||
app.use(express.static("public"));
|
app.use(express.static("public"));
|
||||||
app.use(fileUpload());
|
app.use(fileUpload());
|
||||||
|
|
||||||
|
|
@ -487,7 +488,7 @@ app.put("/workshop/:structure_id/template/:template_id", (req, res) => {
|
||||||
let test_object = req.body.test_object;
|
let test_object = req.body.test_object;
|
||||||
|
|
||||||
model.updateTemplate(db, {
|
model.updateTemplate(db, {
|
||||||
...model.updateTemplate(db, id),
|
...model.getTemplate(db, id),
|
||||||
content,
|
content,
|
||||||
test_object,
|
test_object,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue