refactor(#27): Simplify appraisal
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import {getMarketTypes, MarketTypePrice, useAppraisalStore} from "@/market";
|
||||
import {getMarketTypes, getPrices, MarketTypePrice} from "@/market";
|
||||
import {ref, watch} from 'vue';
|
||||
import {ArrowPathIcon} from '@heroicons/vue/24/outline';
|
||||
import {useAutoRefresh} from '@/composables';
|
||||
@@ -20,7 +20,6 @@ const props = defineProps<Props>();
|
||||
const buyModal = ref<typeof BuyModal>();
|
||||
const sellModal = ref<typeof SellModal>();
|
||||
|
||||
const appraisalStore = useAppraisalStore();
|
||||
const enriched = ref<AcquiredType[]>([]);
|
||||
|
||||
const refresh = async (itms: RawAcquiredType[] = props.items) => {
|
||||
@@ -30,7 +29,7 @@ const refresh = async (itms: RawAcquiredType[] = props.items) => {
|
||||
}
|
||||
|
||||
const types = await getMarketTypes([...new Set(itms.map(i => i.type))]);
|
||||
const prices = await appraisalStore.getPrices(types);
|
||||
const prices = await getPrices(types);
|
||||
|
||||
enriched.value = itms.map(i => {
|
||||
const price = prices.find(p => p.type.id === i.type) as MarketTypePrice;
|
||||
|
||||
Reference in New Issue
Block a user