feat(server): ability to assign the base currency as api query when getting latest ex. rate

This commit is contained in:
Ahmed Bouhuolia
2024-01-28 20:10:23 +02:00
parent 1740226294
commit 74a07847a4
6 changed files with 43 additions and 16 deletions

View File

@@ -20,13 +20,16 @@ function AutoExchangeRateProvider({ children }: AutoExchangeRateProviderProps) {
// Retrieves the exchange rate.
const { data: autoExchangeRate, isLoading: isAutoExchangeRateLoading } =
useLatestExchangeRate(autoExRateCurrency, {
enabled: Boolean(autoExRateCurrency),
refetchOnWindowFocus: false,
staleTime: 0,
cacheTime: 0,
retry: 0,
});
useLatestExchangeRate(
{ fromCurrency: autoExRateCurrency },
{
enabled: Boolean(autoExRateCurrency),
refetchOnWindowFocus: false,
staleTime: 0,
cacheTime: 0,
retry: 0,
},
);
const value = {
autoExRateCurrency,