feat(#14): Wire manual buy/sell to the mammon acquire/consume endpoints
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import {getMarketTypes, TaxInput, useMarketTaxStore} from "@/market";
|
||||
import {BuyModal} from '@/market/acquisition';
|
||||
import {ScanResult, ScanResultTable, toScanResult} from '@/market/scan';
|
||||
import {marketApi} from "@/mammon";
|
||||
import {useStorage} from "@vueuse/core";
|
||||
import {ref, watch} from 'vue';
|
||||
|
||||
const buyModal = ref<typeof BuyModal>();
|
||||
|
||||
const marketTaxStore = useMarketTaxStore();
|
||||
const days = useStorage('market-scan-days', 365);
|
||||
const items = ref<ScanResult[]>([]);
|
||||
@@ -51,8 +48,7 @@ watch([days, () => marketTaxStore.brokerFee, () => marketTaxStore.scc], scan, {
|
||||
<span>Scanning market…</span>
|
||||
</div>
|
||||
<template v-else>
|
||||
<ScanResultTable :items="items" @buy="(type, buy, sell) => buyModal?.open(type, { 'Buy': buy, 'Sell': sell })" />
|
||||
<BuyModal ref="buyModal" />
|
||||
<ScanResultTable :items="items" />
|
||||
</template>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ const result = computedAsync(async () => {
|
||||
|
||||
const acquisitions = computedAsync(async () => {
|
||||
const p = price.value;
|
||||
|
||||
|
||||
return !p ? [] : (await acquisitionApi.findAllAcquisitions(undefined, item.value?.id, true)).data
|
||||
.map(a => ({
|
||||
id: a.acquisitionId,
|
||||
|
||||
Reference in New Issue
Block a user