From 0730c5a34292c27f570c41d2de42e57aef32ee52 Mon Sep 17 00:00:00 2001 From: Dustin Do Date: Mon, 23 Sep 2024 12:53:02 +0700 Subject: [PATCH] feat(currency): add EURO support --- apps/api/v1/services/exchange-rates.service.ts | 2 +- packages/currency/src/index.ts | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/api/v1/services/exchange-rates.service.ts b/apps/api/v1/services/exchange-rates.service.ts index 7e2944d0..5f51e6d7 100644 --- a/apps/api/v1/services/exchange-rates.service.ts +++ b/apps/api/v1/services/exchange-rates.service.ts @@ -5,7 +5,7 @@ import prisma from '../../lib/prisma' const API_KEY = process.env.EXCHANGERATES_API_KEY const BASE_URL = 'http://api.exchangeratesapi.io/v1/' const BASE_CURRENCY = 'EUR' -const DEFAULT_SYMBOLS = ['USD', 'JPY', 'AUD', 'VND', 'SGD', 'CNY'] +const DEFAULT_SYMBOLS = ['USD', 'EURO', 'JPY', 'AUD', 'VND', 'SGD', 'CNY'] const client = got.extend({ prefixUrl: BASE_URL, }) diff --git a/packages/currency/src/index.ts b/packages/currency/src/index.ts index e8751a16..c37a43f5 100644 --- a/packages/currency/src/index.ts +++ b/packages/currency/src/index.ts @@ -2,7 +2,15 @@ import listCurrencies from './currencies.json' export * from './formatter' -export const SUPPORTED_CURRENCIES = ['USD', 'JPY', 'AUD', 'VND', 'SGD', 'CNY'] +export const SUPPORTED_CURRENCIES = [ + 'EUR', + 'USD', + 'JPY', + 'AUD', + 'VND', + 'SGD', + 'CNY', +] export const currencies = listCurrencies.filter((currency) => SUPPORTED_CURRENCIES.includes(currency.code),