diff --git a/backend/src/auth-user/auth-user.service.ts b/backend/src/auth-user/auth-user.service.ts index af30a904519956b3eac308d1eae04953753c931c..f646844a3082c5d9d0be5e8a45b4c1bd13c8040b 100644 --- a/backend/src/auth-user/auth-user.service.ts +++ b/backend/src/auth-user/auth-user.service.ts @@ -13,7 +13,7 @@ export class AuthUserService { /* Metodo para registrar un usuario */ - async register({ name, lastname, email, phone, password }: RegisterDto) { + async register({ name, lastname, email, password }: RegisterDto) { const hashedPassword = await bcryptjs.hash(password, 10); const userExists = await this.userService.findOneByEmail(email); if (userExists) { @@ -23,7 +23,6 @@ export class AuthUserService { name, lastname, email, - phone, password: hashedPassword, }); return { diff --git a/backend/src/auth-user/dto/registrer.dto.ts b/backend/src/auth-user/dto/registrer.dto.ts index 1ec1e11d481f6a52e1f876e882f65e8d6cebfdb2..d4e69390d9033af3f5f786a84b0189e96db209fd 100644 --- a/backend/src/auth-user/dto/registrer.dto.ts +++ b/backend/src/auth-user/dto/registrer.dto.ts @@ -13,13 +13,14 @@ export class RegisterDto { @IsEmail() email: string; - @IsString() + @IsNumber() @MinLength(10) - phone: string; + phone: number; @IsString() @MinLength(8) @Transform(({ value }) => value.trim()) - password: string; + password: string; + } diff --git a/backend/src/user/dto/create-user.dto.ts b/backend/src/user/dto/create-user.dto.ts index 5a592abdb9567be9f5bdcc3751ca9f8e9ce2371e..b9f5a75f5695ee6d4dc57cd6f2a3acd8f2824108 100644 --- a/backend/src/user/dto/create-user.dto.ts +++ b/backend/src/user/dto/create-user.dto.ts @@ -3,5 +3,5 @@ export class CreateUserDto { lastname: string; password: string; email: string; - phone: string; + phone: number; } diff --git a/backend/src/user/entities/user.entity.ts b/backend/src/user/entities/user.entity.ts index c8acdd87723664bab3060139cb783fb798a32724..b3632865b98ba2ba6d182486bde1882d0f7d387e 100644 --- a/backend/src/user/entities/user.entity.ts +++ b/backend/src/user/entities/user.entity.ts @@ -18,5 +18,5 @@ export class User { email: string @Column() - phone: string + phone: number } diff --git a/fronted/aplicacionrutasturisticas/.gitignore b/fronted/aplicacionrutasturisticas/.gitignore index e62807ca0ee3ccca955f363ac6c07d7181f88aa3..fecb9bb9afd0266f23c03c0968089a46b7210844 100644 --- a/fronted/aplicacionrutasturisticas/.gitignore +++ b/fronted/aplicacionrutasturisticas/.gitignore @@ -44,3 +44,6 @@ app.*.map.json pubspec.lock pubspec.yaml +Flutter-Generated.xcconfig +flutter_export_environment.sh +GeneratedPluginRegistrant.swift diff --git a/fronted/aplicacionrutasturisticas/lib/config/dio.dart b/fronted/aplicacionrutasturisticas/lib/config/dio.dart index 1d44319b122fbae7c06f3f0fd3581ce172920fa6..501bfac257fb38be7789ec098f04e3e12be3dbe4 100644 --- a/fronted/aplicacionrutasturisticas/lib/config/dio.dart +++ b/fronted/aplicacionrutasturisticas/lib/config/dio.dart @@ -1,17 +1,16 @@ import 'package:dio/dio.dart'; final dio = Dio(); -void Registro_Datos(String nombre, String lastname, String email, String phone, +void Registro_Datos(String nombre, String lastname, String email, String password) async { Response response; //response = await dio.get("http://172.26.128.1:3000") response = - await dio.post("http://172.31.128.1:3000/auth-user/register", data: { + await dio.post("http://192.168.1.81:3000/auth-user/register", data: { "name": nombre, "lastname": lastname, "password": password, "email": email, - "phone": phone, }); print(response.data.toString()); } diff --git a/fronted/aplicacionrutasturisticas/lib/pages/register.dart b/fronted/aplicacionrutasturisticas/lib/pages/register.dart index b05dc578cc135e12acf756f66e52d058fe2e2043..9c380e13f089f37b026ec116015959a09ecd3be9 100644 --- a/fronted/aplicacionrutasturisticas/lib/pages/register.dart +++ b/fronted/aplicacionrutasturisticas/lib/pages/register.dart @@ -19,11 +19,11 @@ class RegistroPageState extends State { final nombre = TextEditingController(); final apellido = TextEditingController(); final email = TextEditingController(); - final phone = TextEditingController(); + final pasword = TextEditingController(); final passwordConfirmed = TextEditingController(); - String nom = "", ape = "", ema = "", pho = "", pass = "", passc = ""; + String nom = "", ape = "", ema = "", pass = "", passc = ""; @override Widget build(BuildContext context) { @@ -72,13 +72,6 @@ class RegistroPageState extends State { SizedBox( height: 20, ), - ColoredBox( - color: Colors.white, - child: hacerTextField( - controller: phone, - texto: "Numero de teléfono", - ocultar: false)), - SizedBox(height: 20), ColoredBox( color: Colors.white, child: hacerTextField( @@ -113,7 +106,6 @@ class RegistroPageState extends State { nom = nombre.text; ape = apellido.text; ema = email.text; - pho = phone.text; pass = pasword.text; passc = passwordConfirmed.text; @@ -124,15 +116,13 @@ class RegistroPageState extends State { ' ' + ema + ' ' + - pho + - ' ' + pass + ' ' + passc + " \n "); if (pass == passc) { - Registro_Datos(nom, ape, ema, pho, pass); + Registro_Datos(nom, ape, ema, pass); } else { print("La contraseña es incorrecta"); }