rework store usage
This commit is contained in:
@@ -11,7 +11,7 @@ import {CharacterLabel, useCharactersStore} from "@/characters";
|
||||
import {formatEveDate} from "@/formaters.ts";
|
||||
|
||||
const {ledgerId} = useLedgerParam();
|
||||
const {findById} = useCharactersStore();
|
||||
const charactersStore = useCharactersStore();
|
||||
|
||||
const transactions = computedAsync<TransactionResponse[]>(async () => {
|
||||
if (ledgerId.value) {
|
||||
@@ -21,7 +21,7 @@ const transactions = computedAsync<TransactionResponse[]>(async () => {
|
||||
}, []);
|
||||
|
||||
const { sortedArray, headerProps } = useSort(computedAsync(() => Promise.all(transactions.value.map(async transaction => {
|
||||
const character = await findById(transaction.characterId);
|
||||
const character = await charactersStore.findById(transaction.characterId);
|
||||
return {
|
||||
character,
|
||||
characterName: character?.name ?? "",
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import {EditLedgerModal, Ledger, LedgerLabel, useLedgersStore} from "@/ledger";
|
||||
import {storeToRefs} from "pinia";
|
||||
import {nextTick, ref} from "vue";
|
||||
import {PencilSquareIcon} from "@heroicons/vue/24/outline";
|
||||
import {IskLabel} from "@/market";
|
||||
import {SortableHeader, useSort, VirtualScrollTable} from "@/components/table";
|
||||
|
||||
const {ledgers} = storeToRefs(useLedgersStore());
|
||||
const ledgersStore = useLedgersStore();
|
||||
|
||||
const { sortedArray, headerProps } = useSort<Ledger>(ledgers);
|
||||
const { sortedArray, headerProps } = useSort<Ledger>(() => ledgersStore.ledgers);
|
||||
|
||||
const editModal = ref<typeof EditLedgerModal>();
|
||||
const editingLedgerId = ref("");
|
||||
|
||||
Reference in New Issue
Block a user