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