2
0
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:
Faris Ansari 2018-10-05 11:01:53 +05:30
parent 04308fa416
commit c20fd14c05

View File

@ -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);
}));
}
},