eletrotupi / tcc/ commit / cf8e5c6

frontend: fix params dispatched to api client's create user

Pedro Lucas Porcellis porcellis@eletrotupi.com · 5 months ago cf8e5c6ea7f00ce1885858dd493ebce7664e8a06 Browse files
Parents 4808ab9
Changed files
1
Additions
+6
Deletions
-7
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 -
        user: {
70 -
          firstName,
71 -
          lastName,
72 -
          email,
73 -
          password
74 -
        }
69 +
        firstName,
70 +
        lastName,
71 +
        email,
72 +
        password
75 73
      });
74 +

76 75
      router.replace('/');
77 76
    } catch (error: any) {
78 -
	  Alert.alert('Erro:', error.message || 'Falha no cadastro. Tente novamente.');
77 +
      Alert.alert('Erro:', error.message || 'Falha no cadastro. Tente novamente.');
79 78
    }
80 79
  };
81 80

82 81
  return (
83 82
    <SafeAreaView style={[styles.container, { backgroundColor }]}>
212 211
  },
213 212
  footerText: {
214 213
    fontSize: 14,
215 214
  },
216 215
});