eletrotupi / tcc/ commit / 7dd6bda

frontend: wrap user sign up params

Pedro Lucas Porcellis porcellis@eletrotupi.com · 5 months ago 7dd6bda06e1d90ac6bd0cbc1b011352cbcd81b08 Browse files
Parents fe90368
Changed files
1
Additions
+6
Deletions
-4
frontend/app/auth/signup.tsx
1 1
import React, { useState } from 'react';
2 2
import {
3 3
  View,
4 4
  Text,
5 5
  StyleSheet,
64 64
  const handleSignup = async () => {
65 65
    if (!validateForm()) return;
66 66

67 67
    try {
68 68
      await signup({
69 -
        firstName,
70 -
        lastName,
71 -
        email,
72 -
        password,
69 +
        user: {
70 +
          firstName,
71 +
          lastName,
72 +
          email,
73 +
          password
74 +
        }
73 75
      });
74 76
      router.replace('/');
75 77
    } catch (error: any) {
76 78
	  Alert.alert('Erro:', error.message || 'Falha no cadastro. Tente novamente.');
77 79
    }
210 212
  },
211 213
  footerText: {
212 214
    fontSize: 14,
213 215
  },
214 216
});