handle blank post body
This commit is contained in:
parent
24247b7cc5
commit
f32c5a3f41
5
index.js
5
index.js
|
@ -103,9 +103,10 @@ function diff(current, checked) {
|
|||
|
||||
app.post("/updates/:project(\\w+)", (req, res) => {
|
||||
let project_id = req.params['project'];
|
||||
const body = req.body.replace(/\r/, "");
|
||||
const body = req.body || "";
|
||||
let adjustedBody = body.replace(/\r/, "");
|
||||
let indexes = get_indexes(project_id);
|
||||
let difference = diff(indexes, body);
|
||||
let difference = diff(indexes, adjustedBody);
|
||||
|
||||
if (difference.length > 0) {
|
||||
res.send(difference);
|
||||
|
|
Loading…
Reference in New Issue