mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
fix(frontend): fix dropdown in transaction send and link (#3352)
* fix(frontend): fix dropdown in transaction send and link * fix(frontend): use azy query to fetch messages
This commit is contained in:
parent
989a274949
commit
b7ffa94f1e
@ -128,7 +128,7 @@ import ContributionMessagesList from '@/components/ContributionMessages/Contribu
|
||||
import { listContributionMessages } from '@/graphql/queries'
|
||||
import { useAppToast } from '@/composables/useToast'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useQuery } from '@vue/apollo-composable'
|
||||
import { useLazyQuery, useQuery } from '@vue/apollo-composable'
|
||||
|
||||
const props = defineProps({
|
||||
id: {
|
||||
@ -240,7 +240,7 @@ function deleteContribution(item) {
|
||||
}
|
||||
}
|
||||
|
||||
const { onResult, result, loading, error, refetch } = useQuery(listContributionMessages, {
|
||||
const { onResult, onError, load } = useLazyQuery(listContributionMessages, {
|
||||
contributionId: props.contributionId,
|
||||
})
|
||||
|
||||
@ -248,10 +248,8 @@ function getListContributionMessages(closeCollapse = true) {
|
||||
if (closeCollapse) {
|
||||
emit('close-all-open-collapse')
|
||||
}
|
||||
refetch({
|
||||
load(listContributionMessages, {
|
||||
contributionId: props.contributionId,
|
||||
}).catch((err) => {
|
||||
toastError(err.message)
|
||||
})
|
||||
}
|
||||
|
||||
@ -264,6 +262,10 @@ onResult((resultValue) => {
|
||||
}
|
||||
})
|
||||
|
||||
onError((err) => {
|
||||
toastError(err.message)
|
||||
})
|
||||
|
||||
watch(
|
||||
() => visible.value,
|
||||
() => {
|
||||
|
||||
@ -61,13 +61,9 @@ const currentPage = ref(1)
|
||||
const pageSize = ref(5)
|
||||
const pending = ref(false)
|
||||
|
||||
const { refetch, loading, error } = useQuery(
|
||||
listTransactionLinks,
|
||||
() => ({
|
||||
currentPage: currentPage.value,
|
||||
}),
|
||||
{ enabled: false },
|
||||
)
|
||||
const { refetch, loading, error } = useQuery(listTransactionLinks, {
|
||||
currentPage: currentPage.value,
|
||||
})
|
||||
|
||||
watch(currentPage, () => {
|
||||
updateListTransactionLinks()
|
||||
@ -94,11 +90,10 @@ async function updateListTransactionLinks() {
|
||||
} else {
|
||||
pending.value = true
|
||||
try {
|
||||
const result = await refetch()
|
||||
transactionLinks.value = [
|
||||
...transactionLinks.value,
|
||||
...result.data.listTransactionLinks.links,
|
||||
]
|
||||
const { data } = await refetch({
|
||||
currentPage: currentPage.value,
|
||||
})
|
||||
transactionLinks.value = [...transactionLinks.value, ...data.listTransactionLinks.links]
|
||||
emit('update-transactions')
|
||||
} catch (err) {
|
||||
toastError(err.message)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="transaction-slot-send">
|
||||
<BRow class="align-items-center" @click="visible = !visible">
|
||||
<div class="transaction-slot-send" @click="visible = !visible">
|
||||
<BRow class="align-items-center">
|
||||
<BCol cols="3" lg="2" md="2">
|
||||
<avatar
|
||||
:username="username.username"
|
||||
@ -43,7 +43,7 @@
|
||||
<collapse-icon class="text-right" :visible="visible" />
|
||||
</BCol>
|
||||
</BRow>
|
||||
<BCollapse v-model="visible" class="pb-4 pt-lg-3">
|
||||
<BCollapse :model-value="visible" class="pb-4 pt-lg-3">
|
||||
<decay-information
|
||||
:type-id="typeId"
|
||||
:decay="decay"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user