]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/signup/signup.component.ts
Fix dropdown menu in video watch
[github/Chocobozzz/PeerTube.git] / client / src / app / signup / signup.component.ts
index bcbc8ded3b620c195a1ac68512c2d5539a5d7a82..13390a32afc8d25eff5e764bd9d1474ee4a04188 100644 (file)
@@ -12,10 +12,12 @@ import {
   USER_EMAIL,
   USER_PASSWORD
 } from '../shared'
+import { UserCreate } from '../../../../shared'
 
 @Component({
   selector: 'my-signup',
-  templateUrl: './signup.component.html'
+  templateUrl: './signup.component.html',
+  styleUrls: [ './signup.component.scss' ]
 })
 export class SignupComponent extends FormReactive implements OnInit {
   error: string = null
@@ -58,15 +60,15 @@ export class SignupComponent extends FormReactive implements OnInit {
   signup () {
     this.error = null
 
-    const { username, password, email } = this.form.value
+    const userCreate: UserCreate = this.form.value
 
-    this.userService.signup(username, password, email).subscribe(
+    this.userService.signup(userCreate).subscribe(
       () => {
-        this.notificationsService.success('Success', `Registration for ${username} complete.`)
+        this.notificationsService.success('Success', `Registration for ${userCreate.username} complete.`)
         this.router.navigate([ '/videos/list' ])
       },
 
-      err => this.error = err.text
+      err => this.error = err.message
     )
   }
 }