Skip to content

Commit

Permalink
Force successful response for registration
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenaPonsico committed Nov 6, 2023
1 parent bc482c4 commit 7d4c4a4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/app/models/user.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ export class User {
email: string;
password: string;
confirmPassword: string;
//token?: string;
//specialization?: string;
//name?: string;
//accept?: boolean;
token?: string;
specialization?: string;
name?: string;
accept?: boolean;

constructor(
dni: string,
email: string,
password: string,
confirmPassword: string
confirmPassword: string,
// specialization: string,
// name: string,
// accept: boolean
Expand Down
3 changes: 2 additions & 1 deletion src/app/services/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,12 @@ export class AuthService {

// Simular la solicitud con datos de un archivo dummy
return this.http
.post('../assets/dummy/user-register.json', user)
.get<any>('../assets/dummy/response-register.json')
.pipe(
map((authResult: any) => {
this.setLocalStorage(authResult); // Llama a setLocalStorage con el resultado de autenticación
console.log('from auth service ', authResult);
return authResult; // Devuelve el resultado del registro
}),
catchError((error: HttpErrorResponse) => {
// Maneja el error aquí (muestra un mensaje de error)
Expand Down
5 changes: 5 additions & 0 deletions src/assets/dummy/response-register.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"status": "success",
"message": "User registered successfully"
}

0 comments on commit 7d4c4a4

Please sign in to comment.