call mammon for single scan
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
import {ClipboardButton} from '@/components';
|
||||
import {getMarketType, MarketType, MarketTypeInput, useApraisalStore, useMarketTaxStore} from "@/market";
|
||||
import {AcquisitionResultTable, BuyModal, useAcquiredTypesStore} from '@/market/acquisition';
|
||||
import {buildScanResult, ScanResultTable} from '@/market/scan';
|
||||
import {ScanResultTable, toScanResult} from '@/market/scan';
|
||||
import {marketApi} from "@/mammon";
|
||||
import {ShoppingCartIcon} from '@heroicons/vue/24/outline';
|
||||
import log from "loglevel";
|
||||
import {computed, ref, watch} from "vue";
|
||||
@@ -21,7 +22,20 @@ const apraisalStore = useApraisalStore();
|
||||
const marketTaxStore = useMarketTaxStore();
|
||||
const days = useStorage('market-scan-days', 365);
|
||||
const price = computedAsync(() => item.value ? apraisalStore.getPrice(item.value) : undefined);
|
||||
const result = computedAsync(async () => price.value ? await buildScanResult(price.value, days.value, marketTaxStore.calculateProfit) : undefined);
|
||||
const result = computedAsync(async () => {
|
||||
if (!item.value) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const { data } = await marketApi.scanMarketType(
|
||||
String(item.value.id),
|
||||
days.value,
|
||||
marketTaxStore.brokerFee / 100,
|
||||
marketTaxStore.scc / 100
|
||||
);
|
||||
|
||||
return toScanResult(data, item.value);
|
||||
});
|
||||
const acquiredTypesStore = useAcquiredTypesStore();
|
||||
|
||||
const acquisitions = computed(() => {
|
||||
|
||||
Reference in New Issue
Block a user