Skip to content

Commit f1ed068

Browse files
fix: fix uuid param in queries
1 parent c59a0bf commit f1ed068

3 files changed

Lines changed: 20 additions & 6 deletions

File tree

packages/app/src/pages/admin/BillsPage/BillsPage.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,8 @@ const lang = useLang()
158158
159159
const route = useRoute()
160160
161-
const uuids = ref<string[]>((route.params.uuids as string[]) || undefined)
162161
onBeforeRouteUpdate((to) => {
163-
if (to.params.uuids && Array.isArray(to.params.ids)) {
162+
if (to.params.uuids && Array.isArray(to.params.uuids)) {
164163
uuids.value = to.params.uuids as string[]
165164
} else {
166165
uuids.value = undefined
@@ -172,11 +171,17 @@ const {
172171
companyId,
173172
clientId,
174173
clientDetails,
174+
uuids,
175175
page,
176176
rowsPerPage,
177177
paid,
178178
refetch: execute
179179
} = useAdminGetBillsQuery()
180+
181+
if (route.params.uuids && Array.isArray(route.params.uuids)) {
182+
uuids.value = route.params.uuids as string[]
183+
}
184+
180185
const total = computed(() => invoices.value?.at(0)?.total || 0)
181186
182187
const { numberPrefixes, refetch: refetchNumberPrefixes } =

packages/app/src/pages/admin/InvoicesPage/InvoicesPage.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,8 @@ const lang = useLang()
160160
161161
const route = useRoute()
162162
163-
const uuids = ref<string[]>((route.params.uuids as string[]) || undefined)
164163
onBeforeRouteUpdate((to) => {
165-
if (to.params.uuids && Array.isArray(to.params.ids)) {
164+
if (to.params.uuids && Array.isArray(to.params.uuids)) {
166165
uuids.value = to.params.uuids as string[]
167166
} else {
168167
uuids.value = undefined
@@ -177,8 +176,14 @@ const {
177176
invoiceStatus: status,
178177
page,
179178
rowsPerPage,
179+
uuids,
180180
refetch: execute
181181
} = useAdminGetInvoicesQuery()
182+
183+
if (route.params.uuids && Array.isArray(route.params.uuids)) {
184+
uuids.value = route.params.uuids as string[]
185+
}
186+
182187
const total = computed(() => invoices.value?.at(0)?.total || 0)
183188
184189
// const { data: invoices, execute } = useQuery('admin.getInvoices', {

packages/app/src/pages/admin/ReceiptsPage.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,8 @@ import {
9494
9595
const route = useRoute()
9696
97-
const uuids = ref<string[]>((route.params.uuids as string[]) || undefined)
9897
onBeforeRouteUpdate((to) => {
99-
if (to.params.uuids && Array.isArray(to.params.ids)) {
98+
if (to.params.uuids && Array.isArray(to.params.uuids)) {
10099
uuids.value = to.params.uuids as string[]
101100
} else {
102101
uuids.value = undefined
@@ -110,9 +109,14 @@ const {
110109
clientDetails,
111110
page,
112111
rowsPerPage,
112+
uuids,
113113
refetch: execute
114114
} = useAdminGetReceiptsQuery()
115115
116+
if (route.params.uuids && Array.isArray(route.params.uuids)) {
117+
uuids.value = route.params.uuids as string[]
118+
}
119+
116120
const total = computed(() => receipts.value?.at(0)?.total || 0)
117121
118122
const {

0 commit comments

Comments
 (0)