mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
fix: hotbug creating sale invoice.
This commit is contained in:
@@ -112,6 +112,7 @@ export default class CurrenciesController extends BaseController {
|
||||
|
||||
return res.status(200).send({
|
||||
currency_code: currencyDTO.currencyCode,
|
||||
message: 'The currency has been created successfully.',
|
||||
});
|
||||
} catch (error) {
|
||||
next(error);
|
||||
@@ -130,7 +131,10 @@ export default class CurrenciesController extends BaseController {
|
||||
|
||||
try {
|
||||
await this.currenciesService.deleteCurrency(tenantId, currencyCode);
|
||||
return res.status(200).send({ currency_code: currencyCode });
|
||||
return res.status(200).send({
|
||||
currency_code: currencyCode,
|
||||
message: 'The currency has been deleted successfully.',
|
||||
});
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
@@ -149,7 +153,10 @@ export default class CurrenciesController extends BaseController {
|
||||
|
||||
try {
|
||||
const currency = await this.currenciesService.editCurrency(tenantId, currencyId, editCurrencyDTO);
|
||||
return res.status(200).send({ currency_code: currency.currencyCode });
|
||||
return res.status(200).send({
|
||||
currency_code: currency.currencyCode,
|
||||
message: 'The currency has been edited successfully.',
|
||||
});
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
|
||||
@@ -159,7 +159,10 @@ export default class SaleInvoicesController extends BaseController{
|
||||
const storedSaleInvoice = await this.saleInvoiceService.createSaleInvoice(
|
||||
tenantId, saleInvoiceOTD,
|
||||
);
|
||||
return res.status(200).send({ id: storedSaleInvoice.id });
|
||||
return res.status(200).send({
|
||||
id: storedSaleInvoice.id,
|
||||
message: 'The sale invoice has been created successfully.',
|
||||
});
|
||||
} catch (error) {
|
||||
next(error)
|
||||
}
|
||||
@@ -179,7 +182,10 @@ export default class SaleInvoicesController extends BaseController{
|
||||
try {
|
||||
// Update the given sale invoice details.
|
||||
await this.saleInvoiceService.editSaleInvoice(tenantId, saleInvoiceId, saleInvoiceOTD);
|
||||
return res.status(200).send({ id: saleInvoiceId });
|
||||
return res.status(200).send({
|
||||
id: saleInvoiceId,
|
||||
message: 'The sale invoice has beeen edited successfully.',
|
||||
});
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
@@ -221,7 +227,10 @@ export default class SaleInvoicesController extends BaseController{
|
||||
// Deletes the sale invoice with associated entries and journal transaction.
|
||||
await this.saleInvoiceService.deleteSaleInvoice(tenantId, saleInvoiceId);
|
||||
|
||||
return res.status(200).send({ id: saleInvoiceId });
|
||||
return res.status(200).send({
|
||||
id: saleInvoiceId,
|
||||
message: 'The sale invoice has been deleted successfully.',
|
||||
});
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user