mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +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) {
|
||||
// add to router if client-server
|
||||
this.app.post(`/api/method/${method}`, this.asyncHandler(async function(request, response) {
|
||||
const data = await handler(request.body);
|
||||
response.json(data);
|
||||
let data = await handler(request.body);
|
||||
if (data === undefined) {
|
||||
data = {}
|
||||
}
|
||||
return response.json(data);
|
||||
}));
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user