fix(admin): fix refetch data in edit creation form (#3353)

This commit is contained in:
MateuszMichalowski 2024-08-09 13:35:05 +02:00 committed by GitHub
parent b7ffa94f1e
commit f6b827d43b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -123,12 +123,15 @@ watch(selectedComputed, () => {
})
const { mutate: updateMutation, onDone, onError } = useMutation(adminUpdateContribution)
const { refetch: refetchCreations } = useQuery(adminOpenCreations, {
userId: props.creationUserData.id,
})
onDone(() => {
emit('update-creation-data')
toastSuccess(t('creation_form.toasted_update', { value: value.value, email: props.item.email }))
resetForm()
refetchOpenCreations()
refetchCreations()
})
onError((error) => {
@ -136,8 +139,6 @@ onError((error) => {
resetForm()
})
const { refetch: refetchCreations } = useQuery(adminOpenCreations)
const submitCreation = () => {
updateMutation({
id: props.item.id,
@ -150,8 +151,4 @@ const submitCreation = () => {
const resetForm = () => {
value.value = 0
}
const refetchOpenCreations = () => {
refetchCreations()
}
</script>