feat: listing vendors and customers.

feat: items service events.
This commit is contained in:
Ahmed Bouhuolia
2020-10-15 21:27:51 +02:00
parent 899ea7a52d
commit 7397afe2a9
11 changed files with 119 additions and 26 deletions

View File

@@ -196,9 +196,15 @@ export default class VendorsController extends ContactsController {
filterRoles: [],
...this.matchedBodyData(req),
};
try {
const vendors = await this.vendorsService.getVendorsList(tenantId, vendorsFilter);
return res.status(200).send({ vendors });
const { vendors, pagination, filterMeta } = await this.vendorsService.getVendorsList(tenantId, vendorsFilter);
return res.status(200).send({
vendors,
pagination: this.transfromToResponse(pagination),
filter_meta: this.transfromToResponse(filterMeta),
});
} catch (error) {
next(error);
}