perf: refs #7134 use where to get only EUR currency

This commit is contained in:
Javier Segarra 2025-01-21 23:08:42 +01:00
parent ae19e8b3c6
commit 44c7b87726
1 changed files with 3 additions and 4 deletions

View File

@ -112,9 +112,8 @@ async function onFetch(data) {
function round(value) { function round(value) {
return Math.round(value * 100) / 100; return Math.round(value * 100) / 100;
} }
const onFetchCurrencies = (data) => { const onFetchCurrencies = ([currency]) => {
const eur = data.find((currency) => currency.code === 'EUR'); userParams.value.currencyFk = currency?.id;
userParams.value.currencyFk = eur?.id;
}; };
</script> </script>
@ -124,7 +123,7 @@ const onFetchCurrencies = (data) => {
</QDrawer> </QDrawer>
<FetchData <FetchData
url="Currencies" url="Currencies"
:filter="{ fields: ['id', 'code'] }" :filter="{ fields: ['id', 'code'], where: { code: 'EUR' } }"
sort-by="code" sort-by="code"
@on-fetch="onFetchCurrencies" @on-fetch="onFetchCurrencies"
auto-load auto-load