Skip to content

Commit

Permalink
Extract value from Promise array
Browse files Browse the repository at this point in the history
  • Loading branch information
azizjonnurov committed Dec 24, 2024
1 parent 374e3df commit a285482
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/utils/invoiceExport/getInvoiceExportData.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ export const getInvoiceExportData = async ({ ky, intl, query, currency: to }) =>
const allExchangeRates = await Promise.allSettled(
currencies.map(from => ky.get(EXCHANGE_RATE_API, { searchParams: { from, to } }).json()),
);
const exchangeRates = allExchangeRates.filter(({ status }) => status === 'fulfilled');
const exchangeRates = allExchangeRates
.filter(({ status }) => status === 'fulfilled')
.map(({ value }) => value);

return (createInvoiceExportReport({
acqUnitMap: keyBy(acqUnits, 'id'),
Expand Down

0 comments on commit a285482

Please sign in to comment.