Added length of elements in return statement as total_results in api response.
This commit is contained in:
@@ -13,7 +13,7 @@ function historyController(req, res) {
|
|||||||
|
|
||||||
requestRepository.fetchRequested()
|
requestRepository.fetchRequested()
|
||||||
.then((requestedItems) => {
|
.then((requestedItems) => {
|
||||||
res.send({ success: true, requestedItems });
|
res.send({ success: true, results: requestedItems, total_results: requestedItems.length });
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
res.status(401).send({ success: false, error: error.message });
|
res.status(401).send({ success: false, error: error.message });
|
||||||
|
|||||||
Reference in New Issue
Block a user