Skip to content
Snippets Groups Projects
Commit 132edd53 authored by Jérémie BRISON's avatar Jérémie BRISON
Browse files

fix error register

parent 4d485a6b
No related branches found
No related tags found
2 merge requests!68Recette,!67Dev
...@@ -6,5 +6,9 @@ export class User { ...@@ -6,5 +6,9 @@ export class User {
role: number; role: number;
validationToken: string; validationToken: string;
structuresLink: number[]; structuresLink: number[];
pendingStructuresLink: number[]; pendingStructuresLink: number[] = [];
constructor(obj?: any) {
Object.assign(this, obj);
}
} }
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { FormGroup } from '@angular/forms'; import { FormGroup } from '@angular/forms';
import { first } from 'rxjs/operators'; import { first } from 'rxjs/operators';
import { User } from '../../../models/user.model';
import { AuthService } from '../../../services/auth.service'; import { AuthService } from '../../../services/auth.service';
@Component({ @Component({
...@@ -35,7 +36,7 @@ export class SignInModalComponent implements OnInit { ...@@ -35,7 +36,7 @@ export class SignInModalComponent implements OnInit {
this.loading = true; this.loading = true;
this.authService this.authService
.register(form.value) .register(new User(form.value))
.pipe(first()) .pipe(first())
.subscribe( .subscribe(
() => { () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment