diff options
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/users/user.service.ts | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/client/src/app/shared/users/user.service.ts b/client/src/app/shared/users/user.service.ts index e6dc3dbf8..249c589b7 100644 --- a/client/src/app/shared/users/user.service.ts +++ b/client/src/app/shared/users/user.service.ts | |||
@@ -94,4 +94,27 @@ export class UserService { | |||
94 | catchError(res => this.restExtractor.handleError(res)) | 94 | catchError(res => this.restExtractor.handleError(res)) |
95 | ) | 95 | ) |
96 | } | 96 | } |
97 | |||
98 | verifyEmail (userId: number, verificationString: string) { | ||
99 | const url = `${UserService.BASE_USERS_URL}/${userId}/verify-email` | ||
100 | const body = { | ||
101 | verificationString | ||
102 | } | ||
103 | |||
104 | return this.authHttp.post(url, body) | ||
105 | .pipe( | ||
106 | map(this.restExtractor.extractDataBool), | ||
107 | catchError(res => this.restExtractor.handleError(res)) | ||
108 | ) | ||
109 | } | ||
110 | |||
111 | askSendVerifyEmail (email: string) { | ||
112 | const url = UserService.BASE_USERS_URL + '/ask-send-verify-email' | ||
113 | |||
114 | return this.authHttp.post(url, { email }) | ||
115 | .pipe( | ||
116 | map(this.restExtractor.extractDataBool), | ||
117 | catchError(err => this.restExtractor.handleError(err)) | ||
118 | ) | ||
119 | } | ||
97 | } | 120 | } |