File

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

Constructor

constructor(learnerService: any, configService: any, http: HttpClient)

Methods

generateOTP
generateOTP(data: any)
Returns: void
verifyOTP
verifyOTP(data: any)
Returns: void
getUserByKey
getUserByKey(data: any)
Returns: void
checkUserExists
checkUserExists(data: any)
Returns: void
createUser
createUser(data: any)
Returns: void
getTncConfig
getTncConfig()

Fetches terms and condition config data

Returns: void
acceptTermsAndConditions
acceptTermsAndConditions(data: any)

Accepts Terms and conditions and generate token of user

Parameters :
  • data
Returns: void
createUserV3
createUserV3(data: any)
Returns: void

Properties

configService
configService: any
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);
  }

  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.SIGNUP,
      data: data
    };
    return this.learnerService.post(options);
  }

  /**
   * Fetches terms and condition config data
   */
  getTncConfig() {
    const options = {
      url: this.configService.urlConFig.URLS.SYSTEM_SETTING.TNC_CONFIG
    };
    return this.learnerService.get(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,
      data: data
    };
    return this.learnerService.post(options);
  }
}

results matching ""

    No results matching ""