(email?: string, token?: string)
| 28 | * Auto-runs on mount once both `email` and `token` are present. |
| 29 | */ |
| 30 | export function useUnsubscribe(email?: string, token?: string) { |
| 31 | return useQuery({ |
| 32 | queryKey: unsubscribeKeys.detail(email, token), |
| 33 | queryFn: ({ signal }) => fetchUnsubscribe(email as string, token as string, signal), |
| 34 | enabled: Boolean(email) && Boolean(token), |
| 35 | staleTime: 5 * 60 * 1000, |
| 36 | retry: false, |
| 37 | }) |
| 38 | } |
| 39 | |
| 40 | interface UnsubscribeVariables { |
| 41 | email: string |
no test coverage detected