mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 23:00:34 +00:00
fix: edit exchange rate api.
This commit is contained in:
@@ -142,11 +142,16 @@ export default class ExchangeRatesController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
async editExchangeRate(req: Request, res: Response, next: NextFunction) {
|
async editExchangeRate(req: Request, res: Response, next: NextFunction) {
|
||||||
const { tenantId } = req;
|
const { tenantId } = req;
|
||||||
|
const { id: exchangeRateId } = req.params;
|
||||||
const exchangeRateDTO = this.matchedBodyData(req);
|
const exchangeRateDTO = this.matchedBodyData(req);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const exchangeRate = await this.exchangeRatesService.newExchangeRate(tenantId, exchangeRateDTO)
|
const exchangeRate = await this.exchangeRatesService.editExchangeRate(tenantId, exchangeRateId, exchangeRateDTO)
|
||||||
return res.status(200).send({ id: exchangeRate.id });
|
|
||||||
|
return res.status(200).send({
|
||||||
|
id: exchangeRateId,
|
||||||
|
message: 'The exchange rate has been edited successfully.',
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
next(error);
|
next(error);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user