refactor: remove refresh from stores

This commit is contained in:
Sophie-Gaëlle CALLOCH
2026-07-07 15:41:01 +02:00
parent 2622d9f01e
commit 75d1d5f7fa
8 changed files with 24 additions and 31 deletions
+6 -2
View File
@@ -21,7 +21,7 @@ const sellModal = ref<typeof SellModal>();
const apraisalStore = useApraisalStore();
const enriched = ref<AcquiredType[]>([]);
watch(() => props.items, async itms => {
const refresh = async (itms: RawAcquiredType[] = props.items) => {
if (itms.length === 0) {
enriched.value = [];
return;
@@ -40,7 +40,11 @@ watch(() => props.items, async itms => {
sell: price.sell
};
});
}, {immediate: true});
};
watch(() => props.items, refresh, {immediate: true});
defineExpose({refresh});
</script>
<template>