@@ -39,12 +39,20 @@ const icon = computed<{ component: Component; color: string } | null>(() => {
3939 return null ;
4040});
4141
42- const archive = useMutation (archiveMutation , {
43- variables: { id: props .id },
44- });
42+ const archive = reactive (
43+ useMutation (archiveMutation , {
44+ variables: { id: props .id },
45+ })
46+ );
47+
48+ const deleteNotification = reactive (
49+ useMutation (deleteMutation , {
50+ variables: { id: props .id , type: props .type },
51+ })
52+ );
4553
46- const deleteNotification = useMutation ( deleteMutation , {
47- variables: { id: props . id , type: props . type },
54+ const mutationError = computed (() => {
55+ return archive . error ?. message ?? deleteNotification . error ?. message ;
4856});
4957 </script >
5058
@@ -81,6 +89,8 @@ const deleteNotification = useMutation(deleteMutation, {
8189 <p class =" text-secondary-foreground" >{{ description }}</p >
8290 </div >
8391
92+ <p v-if =" mutationError" class =" text-red-600" >Error: {{ mutationError }}</p >
93+
8494 <div class =" flex justify-end items-baseline gap-2" >
8595 <a v-if =" link" :href =" link" >
8696 <Button type =" button" variant =" outline" size =" xs" >
0 commit comments