From e388b37aa6f1cf8039d0fb72aaa60e7709315cd3 Mon Sep 17 00:00:00 2001 From: Pujit Mehrotra Date: Fri, 1 Nov 2024 12:15:59 -0400 Subject: [PATCH] refactor(web): simplify naming of notification mutations --- web/components/Notifications/Item.vue | 28 +++++++++++---------------- web/helpers/apollo-cache/prefixes.ts | 2 +- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/web/components/Notifications/Item.vue b/web/components/Notifications/Item.vue index 7a487e2ef..2e3cf34f4 100644 --- a/web/components/Notifications/Item.vue +++ b/web/components/Notifications/Item.vue @@ -13,7 +13,7 @@ import type { NotificationFragmentFragment } from "~/composables/gql/graphql"; import { NotificationType } from "~/composables/gql/graphql"; import { archiveNotification as archiveMutation, - deleteNotification, + deleteNotification as deleteMutation, } from "./graphql/notification.query"; const props = defineProps(); @@ -39,19 +39,13 @@ const icon = computed<{ component: Component; color: string } | null>(() => { return null; }); -const { mutate: archive, loading: archiveInProgress } = useMutation( - archiveMutation, - { - variables: { id: props.id }, - } -); +const archive = useMutation(archiveMutation, { + variables: { id: props.id }, +}); -const { mutate: deleteFromServer, loading: deleting } = useMutation( - deleteNotification, - { - variables: { id: props.id, type: props.type }, - } -); +const deleteNotification = useMutation(deleteMutation, { + variables: { id: props.id, type: props.type }, +});