Advertisement
Guest User

Untitled

a guest
Aug 14th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     register(email: string, username: string, password: string, image: string, type: number): Promise<any> {
  2.         return new Promise(resolve => {
  3.             if (type === 1) {
  4.                 this.http.post(this.userRegisterUrl, { email: email, username: username, password: password, image: image, type: type })
  5.                     .toPromise()
  6.                     .then(response => {
  7.                         resolve(response);
  8.                     })
  9.                     .catch(this.handleError);
  10.             } else if (type === 2 || type === 3) {
  11.                 this.http.post(this.userRegisterUrl, { email: email, username: username, token: password, image: image, type: type })
  12.                     .toPromise()
  13.                     .then(response => {
  14.                         resolve(response);
  15.                     })
  16.                     .catch(this.handleError);
  17.             }
  18.         });
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement