mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-14 19:22:14 +01:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2f3fe411a |
@@ -6,7 +6,7 @@ import { ref } from 'vue';
|
|||||||
import PrimaryButton from '../../../packages/ui/src/Buttons/PrimaryButton.vue';
|
import PrimaryButton from '../../../packages/ui/src/Buttons/PrimaryButton.vue';
|
||||||
import { Field, FieldLabel } from '@/packages/ui/src/field';
|
import { Field, FieldLabel } from '@/packages/ui/src/field';
|
||||||
import type { CreateReportBody, CreateReportBodyProperties } from '@/packages/api/src';
|
import type { CreateReportBody, CreateReportBodyProperties } from '@/packages/api/src';
|
||||||
import { useMutation } from '@tanstack/vue-query';
|
import { useMutation, useQueryClient } from '@tanstack/vue-query';
|
||||||
import { getCurrentOrganizationId } from '@/utils/useUser';
|
import { getCurrentOrganizationId } from '@/utils/useUser';
|
||||||
import { api } from '@/packages/api/src';
|
import { api } from '@/packages/api/src';
|
||||||
import { Checkbox } from '@/packages/ui/src';
|
import { Checkbox } from '@/packages/ui/src';
|
||||||
@@ -17,6 +17,7 @@ import { router } from '@inertiajs/vue3';
|
|||||||
|
|
||||||
const show = defineModel('show', { default: false });
|
const show = defineModel('show', { default: false });
|
||||||
const saving = ref(false);
|
const saving = ref(false);
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const createReportMutation = useMutation({
|
const createReportMutation = useMutation({
|
||||||
mutationFn: async (report: CreateReportBody) => {
|
mutationFn: async (report: CreateReportBody) => {
|
||||||
@@ -30,6 +31,11 @@ const createReportMutation = useMutation({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
onSuccess: () => {
|
||||||
|
queryClient.invalidateQueries({
|
||||||
|
queryKey: ['reports'],
|
||||||
|
});
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
|||||||
Reference in New Issue
Block a user