useRegisterApi.ts 456 B

123456789101112131415161718192021
  1. interface RegisterPayload {
  2. name: string
  3. cpf: string
  4. email: string
  5. phone: string
  6. position_label: string
  7. sector_label: string
  8. }
  9. export const useRegisterApi = () => {
  10. const { apiUrl } = useRuntimeConfig().public
  11. const registerLandingUser = async (data: RegisterPayload): Promise<void> => {
  12. await $fetch(`${apiUrl}/api/landing-page-register-user`, {
  13. method: 'POST',
  14. body: data,
  15. })
  16. }
  17. return { registerLandingUser }
  18. }