mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +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) {
|
||||
const { tenantId } = req;
|
||||
const { id: exchangeRateId } = req.params;
|
||||
const exchangeRateDTO = this.matchedBodyData(req);
|
||||
|
||||
try {
|
||||
const exchangeRate = await this.exchangeRatesService.newExchangeRate(tenantId, exchangeRateDTO)
|
||||
return res.status(200).send({ id: exchangeRate.id });
|
||||
const exchangeRate = await this.exchangeRatesService.editExchangeRate(tenantId, exchangeRateId, exchangeRateDTO)
|
||||
|
||||
return res.status(200).send({
|
||||
id: exchangeRateId,
|
||||
message: 'The exchange rate has been edited successfully.',
|
||||
});
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user