mirror of
https://github.com/frappe/books.git
synced 2025-01-11 10:38:14 +00:00
Handle empty response in frappe.call
This commit is contained in:
parent
04308fa416
commit
c20fd14c05
7
index.js
7
index.js
@ -56,8 +56,11 @@ module.exports = {
|
|||||||
if (this.app) {
|
if (this.app) {
|
||||||
// add to router if client-server
|
// add to router if client-server
|
||||||
this.app.post(`/api/method/${method}`, this.asyncHandler(async function(request, response) {
|
this.app.post(`/api/method/${method}`, this.asyncHandler(async function(request, response) {
|
||||||
const data = await handler(request.body);
|
let data = await handler(request.body);
|
||||||
response.json(data);
|
if (data === undefined) {
|
||||||
|
data = {}
|
||||||
|
}
|
||||||
|
return response.json(data);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user