File

src/app/modules/public/module/signup/services/signup/signup.service.ts

Index

Properties
Methods

Constructor

constructor(learnerService: LearnerService, configService: ConfigService, http: HttpClient)
Parameters :
Name Type Optional
learnerService LearnerService No
configService ConfigService No
http HttpClient No

Methods

acceptTermsAndConditions
acceptTermsAndConditions(data)

Accepts Terms and conditions and generate token of user

Parameters :
Name Optional
data No
Returns : any
checkUserExists
checkUserExists(data)
Parameters :
Name Optional
data No
Returns : any
createUser
createUser(data)
Parameters :
Name Optional
data No
Returns : any
createUserV3
createUserV3(data)
Parameters :
Name Optional
data No
Returns : any
generateOTP
generateOTP(data)
Parameters :
Name Optional
data No
Returns : any
generateOTPforAnonymousUser
generateOTPforAnonymousUser(data, captchaResponse)
Parameters :
Name Optional
data No
captchaResponse No
Returns : any
getUserByKey
getUserByKey(data)
Parameters :
Name Optional
data No
Returns : any
verifyOTP
verifyOTP(data)
Parameters :
Name Optional
data No
Returns : any

Properties

Public configService
Type : ConfigService
import { Injectable } from '@angular/core';
import { LearnerService } from '@sunbird/core';
import { ConfigService } from '@sunbird/shared';
import {HttpClient} from '@angular/common/http';

@Injectable({
  providedIn: 'root'
})
export class SignupService {

  constructor(private learnerService: LearnerService, public configService: ConfigService,
              private http: HttpClient) {
  }

  generateOTP(data) {
    const options = {
      url: this.configService.urlConFig.URLS.OTP.GENERATE,
      data: data
    };
    return this.learnerService.post(options);
  }

  generateOTPforAnonymousUser(data, captchaResponse) {
    const options = {
      url: this.configService.urlConFig.URLS.OTP.ANONYMOUS.GENERATE + '?captchaResponse=' + captchaResponse,
      data: data
    };
    return this.learnerService.post(options);
  }

  verifyOTP(data) {
    const options = {
      url: this.configService.urlConFig.URLS.OTP.VERIFY,
      data: data
    };
    return this.learnerService.post(options);
  }

  getUserByKey(data) {
    const options = {
      url: this.configService.urlConFig.URLS.USER.GET_USER_BY_KEY + '/' + data,
    };
    return this.learnerService.get(options);
  }

  checkUserExists(data) {
    const options = {
      url: this.configService.urlConFig.URLS.USER.CHECK_USER_EXISTS + '/' + data,
    };
    return this.learnerService.get(options);
  }

  createUser(data) {
    const options = {
      url: this.configService.urlConFig.URLS.USER.CREATE_V2,
      data: data
    };
    return this.learnerService.post(options);
  }

  /**
   * Accepts Terms and conditions and generate token of user
   * @param data
   */
  acceptTermsAndConditions(data) {
    const url = this.configService.urlConFig.URLS.USER.TNC_ACCEPT_LOGIN;
    return this.http.post(url, data);
  }

  createUserV3(data) {
    const options = {
      url: this.configService.urlConFig.URLS.USER.SIGN_UP_V1,
      data: data
    };
    return this.learnerService.post(options);
  }
}

results matching ""

    No results matching ""