feat: add done/checkbox support to PATCH handler
This commit is contained in:
@@ -48,6 +48,7 @@ app.patch('/api/notes/:id', (req, res) => {
|
|||||||
if (req.body.text !== undefined) note.text = req.body.text;
|
if (req.body.text !== undefined) note.text = req.body.text;
|
||||||
if (req.body.column !== undefined) note.column = req.body.column;
|
if (req.body.column !== undefined) note.column = req.body.column;
|
||||||
if (req.body.order !== undefined) note.order = req.body.order;
|
if (req.body.order !== undefined) note.order = req.body.order;
|
||||||
|
if (req.body.done !== undefined) note.done = req.body.done;
|
||||||
if (req.body.reorder) {
|
if (req.body.reorder) {
|
||||||
req.body.reorder.forEach(r => {
|
req.body.reorder.forEach(r => {
|
||||||
const n = data.notes.find(x => x.id === r.id);
|
const n = data.notes.find(x => x.id === r.id);
|
||||||
|
|||||||
Reference in New Issue
Block a user