|
|
|
@ -1,5 +1,5 @@ |
|
|
|
|
import { Controller, Post, UsePipes, Body } from '@nestjs/common'; |
|
|
|
|
import { ExchangeRateInput } from 'src/exchange-rate/exchange-rate.dto'; |
|
|
|
|
import { ExchangeRateInput, ExchangeRateResponse } from 'src/exchange-rate/exchange-rate.dto'; |
|
|
|
|
import { ExchangeRateService } from 'src/exchange-rate/exchange-rate.service'; |
|
|
|
|
import { TransactionService } from './transaction.service'; |
|
|
|
|
import { transactionBodySchema } from './transaction.validation'; |
|
|
|
@ -112,7 +112,7 @@ export class TransactionController { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getExchangeRate(exchangeRateInput: ExchangeRateInput) { |
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
return new Promise<ExchangeRateResponse>((resolve, reject) => { |
|
|
|
|
try { |
|
|
|
|
this.exchangeRateService.convertCurrency(exchangeRateInput).subscribe({ |
|
|
|
|
next: resolve, |
|
|
|
|