HOTFIX: Missing data would crash the site

This commit is contained in:
2021-07-25 10:35:13 +01:00
parent 1b9e35539e
commit fd1ba06b45
4 changed files with 19 additions and 6 deletions
+3 -3
View File
@@ -25,9 +25,9 @@ const route = async (req, res) => {
//update the data
await articles.update({
title: req.body.title,
author: req.body.author,
body: req.body.body,
title: req.body.title || record.title,
author: req.body.author || record.author,
body: req.body.body || record.body,
edits: record.edits + 1
}, {
where: {