]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts
Split user service
[github/Chocobozzz/PeerTube.git] / client / src / app / +signup / +verify-account / verify-account-ask-send-email / verify-account-ask-send-email.component.ts
index afb0e6d6c58087f5f8e19d9a2d6c0b896f3a9f43..a0ed66a3a1bb193bb7e511eb1f461c37422a400d 100644 (file)
@@ -1,7 +1,8 @@
 import { Component, OnInit } from '@angular/core'
-import { Notifier, RedirectService, ServerService, UserService } from '@app/core'
+import { Notifier, RedirectService, ServerService } from '@app/core'
 import { USER_EMAIL_VALIDATOR } from '@app/shared/form-validators/user-validators'
 import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
+import { UserSignupService } from '@app/shared/shared-users'
 
 @Component({
   selector: 'my-verify-account-ask-send-email',
@@ -14,7 +15,7 @@ export class VerifyAccountAskSendEmailComponent extends FormReactive implements
 
   constructor (
     protected formValidatorService: FormValidatorService,
-    private userService: UserService,
+    private userSignupService: UserSignupService,
     private serverService: ServerService,
     private notifier: Notifier,
     private redirectService: RedirectService
@@ -33,16 +34,14 @@ export class VerifyAccountAskSendEmailComponent extends FormReactive implements
 
   askSendVerifyEmail () {
     const email = this.form.value['verify-email-email']
-    this.userService.askSendVerifyEmail(email)
-      .subscribe(
-        () => {
+    this.userSignupService.askSendVerifyEmail(email)
+      .subscribe({
+        next: () => {
           this.notifier.success($localize`An email with verification link will be sent to ${email}.`)
           this.redirectService.redirectToHomepage()
         },
 
-        err => {
-          this.notifier.error(err.message)
-        }
-      )
+        error: err => this.notifier.error(err.message)
+      })
   }
 }