mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
refactoring: payment made form.
This commit is contained in:
@@ -54,6 +54,15 @@ export default class PaymentReceivesController extends BaseController {
|
||||
asyncMiddleware(this.getPaymentReceiveEditPage.bind(this)),
|
||||
this.handleServiceErrors
|
||||
);
|
||||
router.get(
|
||||
'/new-page/entries',
|
||||
[
|
||||
query('customer_id').exists().isNumeric().toInt(),
|
||||
],
|
||||
this.validationResult,
|
||||
asyncMiddleware(this.getPaymentReceiveNewPageEntries.bind(this)),
|
||||
this.getPaymentReceiveNewPageEntries.bind(this)
|
||||
);
|
||||
router.get(
|
||||
'/',
|
||||
this.validatePaymentReceiveList,
|
||||
@@ -303,6 +312,26 @@ export default class PaymentReceivesController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve payment receive new page receivable entries.
|
||||
* @param {Request} req - Request.
|
||||
* @param {Response} res - Response.
|
||||
*/
|
||||
async getPaymentReceiveNewPageEntries(req, res) {
|
||||
const { tenantId } = req;
|
||||
const { customerId } = this.matchedQueryData(req);
|
||||
|
||||
try {
|
||||
const entries = await this.paymentReceiveService.getNewPageEntries(
|
||||
tenantId,
|
||||
customerId
|
||||
);
|
||||
return res.status(200).send({
|
||||
entries: this.transfromToResponse(entries),
|
||||
});
|
||||
} catch (error) {}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles service errors.
|
||||
* @param error
|
||||
|
||||
Reference in New Issue
Block a user