about summary refs log tree commit diff
path: root/src/components/dialogs/EmailDialog/data/useRequestEmailUpdate.ts
blob: a442662fcf1df254d9c7ca24f33dab0996bb7d43 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import {useMutation} from '@tanstack/react-query'

import {useAgent} from '#/state/session'

export function useRequestEmailUpdate() {
  const agent = useAgent()

  return useMutation({
    mutationFn: async () => {
      return (await agent.com.atproto.server.requestEmailUpdate()).data
    },
  })
}