transaction list api
This commit is contained in:
+12
-5
@@ -1,19 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
import {RouterView} from 'vue-router';
|
||||
import {CreateLedgerModal} from "@/ledger";
|
||||
import {EditLedgerModal, useLedgersStore} from "@/ledger";
|
||||
import {ref} from "vue";
|
||||
import {processingApi} from "@/mammon";
|
||||
|
||||
const createLedgerModal = ref<typeof CreateLedgerModal>();
|
||||
const {refresh} = useLedgersStore();
|
||||
|
||||
const editLedgerModal = ref<typeof EditLedgerModal>();
|
||||
|
||||
const processActivities = async () => {
|
||||
await processingApi.processNewActivities();
|
||||
await refresh();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="mt-4">
|
||||
<div class="mb-4 border-b-1 flex justify-end">
|
||||
<button class="mb-2 ms-2" @click="processingApi.processNewActivities()">Process Activities</button>
|
||||
<button class="mb-2 ms-2" @click="createLedgerModal?.open()">New Ledger</button>
|
||||
<button class="mb-2 ms-2" @click="processActivities">Process Activities</button>
|
||||
<button class="mb-2 ms-2" @click="editLedgerModal?.open()">New Ledger</button>
|
||||
</div>
|
||||
<CreateLedgerModal ref="createLedgerModal" />
|
||||
<EditLedgerModal ref="editLedgerModal" />
|
||||
<RouterView />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import {CreateLedgerModal, LedgerLabel, useLedgersStore} from "@/ledger";
|
||||
import {EditLedgerModal, LedgerLabel, useLedgersStore} from "@/ledger";
|
||||
import {storeToRefs} from "pinia";
|
||||
import {nextTick, ref} from "vue";
|
||||
import {PencilSquareIcon} from "@heroicons/vue/24/outline";
|
||||
@@ -8,7 +8,7 @@ import {formatIsk} from "@/formaters.ts";
|
||||
|
||||
const {ledgers} = storeToRefs(useLedgersStore());
|
||||
|
||||
const editModal = ref<typeof CreateLedgerModal>();
|
||||
const editModal = ref<typeof EditLedgerModal>();
|
||||
const editingLedgerId = ref("");
|
||||
|
||||
const openEdit = async (ledgerId: string) => {
|
||||
@@ -29,5 +29,5 @@ const openEdit = async (ledgerId: string) => {
|
||||
<button class="btn-icon ms-2" @click="openEdit(ledger.ledgerId)"><PencilSquareIcon /></button>
|
||||
</div>
|
||||
</div>
|
||||
<CreateLedgerModal ref="editModal" :ledger-id="editingLedgerId" />
|
||||
<EditLedgerModal ref="editModal" :ledger-id="editingLedgerId" />
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user