Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- register(email: string, username: string, password: string, image: string, type: number): Promise<any> {
- return new Promise(resolve => {
- if (type === 1) {
- this.http.post(this.userRegisterUrl, { email: email, username: username, password: password, image: image, type: type })
- .toPromise()
- .then(response => {
- resolve(response);
- })
- .catch(this.handleError);
- } else if (type === 2 || type === 3) {
- this.http.post(this.userRegisterUrl, { email: email, username: username, token: password, image: image, type: type })
- .toPromise()
- .then(response => {
- resolve(response);
- })
- .catch(this.handleError);
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement