( userId: string, queryClient: QueryClient, )
| 146 | }; |
| 147 | |
| 148 | export const disableNotification = ( |
| 149 | userId: string, |
| 150 | queryClient: QueryClient, |
| 151 | ) => { |
| 152 | return { |
| 153 | mutationFn: async (templateId: string) => { |
| 154 | const result = await API.putUserNotificationPreferences(userId, { |
| 155 | template_disabled_map: { |
| 156 | [templateId]: true, |
| 157 | }, |
| 158 | }); |
| 159 | return result; |
| 160 | }, |
| 161 | onSuccess: (data) => { |
| 162 | queryClient.setQueryData(userNotificationPreferencesKey(userId), data); |
| 163 | }, |
| 164 | } satisfies UseMutationOptions<NotificationPreference[], unknown, string>; |
| 165 | }; |
no test coverage detected