diff --git a/src/app/client/src/app/modules/public/module/signup/components/otp/otp.component.ts b/src/app/client/src/app/modules/public/module/signup/components/otp/otp.component.ts index 8832080aa31..5b83123a387 100644 --- a/src/app/client/src/app/modules/public/module/signup/components/otp/otp.component.ts +++ b/src/app/client/src/app/modules/public/module/signup/components/otp/otp.component.ts @@ -216,7 +216,6 @@ export class OtpComponent implements OnInit { }; createRequest.request['location'] = locationInfo; createRequest.request['reqData'] = _.get(data, 'reqData'); - console.log("createUser---",JSON.stringify(createRequest)); if (this.otpForm.controls.tncAccepted.value && this.otpForm.controls.tncAccepted.status === 'VALID') { this.signupService.createUserV3(createRequest).subscribe((resp: ServerResponse) => { if(resp.responseCode=== 'OK' && resp.result.userId) { @@ -236,11 +235,8 @@ export class OtpComponent implements OnInit { firstName: createRequest.request.firstName }; - console.log("payload---",JSON.stringify(payload)); this.locationService.updateProfile(payload).toPromise() .then((res) => { - console.log("locUpdate res---", JSON.stringify(res)); - // this.registerSubmit.emit(_.get(result, 'value')); this.toasterService.success(this.resourceService?.messages?.smsg?.m0057); }).catch((err) => { console.log("Error for location selection", err); diff --git a/src/app/client/src/app/modules/public/module/signup/components/test-location/test-location.component.html b/src/app/client/src/app/modules/public/module/signup/components/test-location/test-location.component.html deleted file mode 100644 index ad6e01ea7df..00000000000 --- a/src/app/client/src/app/modules/public/module/signup/components/test-location/test-location.component.html +++ /dev/null @@ -1 +0,0 @@ -

test-location works!

diff --git a/src/app/client/src/app/modules/public/module/signup/components/test-location/test-location.component.scss b/src/app/client/src/app/modules/public/module/signup/components/test-location/test-location.component.scss deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/app/client/src/app/modules/public/module/signup/components/test-location/test-location.component.spec.ts b/src/app/client/src/app/modules/public/module/signup/components/test-location/test-location.component.spec.ts deleted file mode 100644 index b4b3959fc4f..00000000000 --- a/src/app/client/src/app/modules/public/module/signup/components/test-location/test-location.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { TestLocationComponent } from './test-location.component'; - -describe('TestLocationComponent', () => { - let component: TestLocationComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ TestLocationComponent ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TestLocationComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/client/src/app/modules/public/module/signup/components/test-location/test-location.component.ts b/src/app/client/src/app/modules/public/module/signup/components/test-location/test-location.component.ts deleted file mode 100644 index f1296a13fa2..00000000000 --- a/src/app/client/src/app/modules/public/module/signup/components/test-location/test-location.component.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import {Location as SbLocation} from '@project-sunbird/client-services/models/location'; -import { SignupService } from './../../services'; -import {ServerResponse, ResourceService, ToasterService} from '@sunbird/shared'; -import * as _ from 'lodash'; -import { LocationService } from '../../../../../../plugins/location'; -@Component({ - selector: 'app-test-location', - templateUrl: './test-location.component.html', - styleUrls: ['./test-location.component.scss'] -}) -export class TestLocationComponent implements OnInit { - - constructor( public locationService: LocationService, public signupService: SignupService, private resourceService: ResourceService, - private toasterService: ToasterService,) { } - - ngOnInit(): void { - this.updateLocation(); - } - - updateLocation() { - const createRequest = {"params":{"source":"portal","signupType":"self"}, - "request":{"firstName":"tbg","password":"Test@12345","dob":"2019","email":"tejaswinig111@yopmail.com", - "emailVerified":true,"reqData":"{\"iv\":\"644e510950876b7850f67dfcebd72e53\",\"encryptedData\":\"aa58f3a1f3f5fc537db38eed602c08e69cb8664efcd0a198670652175d16dcb5f33c67a607d02216109ed9a772f4cc5666d470bcf9e21618c60db2991eae9742\"}"}}; - const startingForm = {"basicInfo":{"name":"tbg","yearOfBirth":"2019","isMinor":true}, - "onboardingInfo":{"persona":"teacher","children":{"persona":{"state":{"code":"28","name":"Andhra Pradesh","id":"0393395d-ea39-49e0-8324-313b4df4a550","type":"state"}, - "district":{"identifier":"640a1938-1f23-48f9-9e3b-75bc862b769d","code":"2822","name":"Ananthapuram","id":"640a1938-1f23-48f9-9e3b-75bc862b769d","type":"district","parentId":"0393395d-ea39-49e0-8324-313b4df4a550"},"block":{"identifier":"9525bce5-f91b-4d01-89a0-36acf76e0036","code":"282224","name":"Atmakur","id":"9525bce5-f91b-4d01-89a0-36acf76e0036","type":"block","parentId":"640a1938-1f23-48f9-9e3b-75bc862b769d"},"cluster":{"identifier":"bb8a385e-8fd0-4a07-8d85-0a2a2fe99719","code":"2822240002","name":"Zphs Atmakur","id":"bb8a385e-8fd0-4a07-8d85-0a2a2fe99719","type":"cluster","parentId":"9525bce5-f91b-4d01-89a0-36acf76e0036"},"school":{"code":"28222400403","parentId":"bb8a385e-8fd0-4a07-8d85-0a2a2fe99719","type":"school","name":"Mpps South Atmakur","id":"0127261026390016007274","identifier":"0127261026390016007274"}}}},"emailPassInfo":{"key":"tejaswinig111@yopmail.com","type":"email","templateId":"wardLoginOTP","password":"Test@12345"},"routeParams":{"client_id":"portal","state":"80018604-b58d-44cf-a441-30da3f90db15","redirect_uri":"https://dev.oci.diksha.gov.in/resources?board=CBSE&medium=English&gradeLevel=Class%202&&id=cisce_k-12&selectedTab=textbook&auth_callback=1","scope":"openid","response_type":"code","version":"4", - "error_callback":"https://dev.oci.diksha.gov.in/auth/realms/sunbird/protocol/openid-connect/auth"}}; - const locationDetails: SbLocation[] = Object.keys(_.get(startingForm, 'onboardingInfo.children.persona')) - .reduce((acc, key) => { - const locationDetail: SbLocation | null = _.get(startingForm, 'onboardingInfo.children.persona')[key]; - if (_.get(locationDetail, 'code')) { - acc.push(locationDetail); - } - return acc; - }, []); - const userTypes = [{ type: 'teacher' }]; - const payload: any = { - userId: "10cb52a9-8496-453c-9c1f-5d13cf31296b", - profileLocation: locationDetails, - profileUserTypes: userTypes, - firstName: createRequest.request.firstName - - }; - console.log("payload---",payload); - this.locationService.updateProfile(payload).toPromise() - .then((res) => { - console.log("locUpdate res---", JSON.stringify(res)); - // this.registerSubmit.emit(_.get(result, 'value')); - this.toasterService.success(this.resourceService?.messages?.smsg?.m0057); - }).catch((err) => { - console.log("Error for location selection", err); - this.toasterService.error(this.resourceService?.messages?.emsg?.m0005); - }); - } - -} diff --git a/src/app/client/src/app/modules/public/module/signup/signup.module.ts b/src/app/client/src/app/modules/public/module/signup/signup.module.ts index e4f62630228..3b3fd7a1139 100644 --- a/src/app/client/src/app/modules/public/module/signup/signup.module.ts +++ b/src/app/client/src/app/modules/public/module/signup/signup.module.ts @@ -10,7 +10,6 @@ import { TelemetryModule } from '@sunbird/telemetry'; import { SharedModule } from '@sunbird/shared'; import { SharedFeatureModule } from '@sunbird/shared-feature'; import { LocationModule, LocationService } from '../../../../plugins/location'; -import { TestLocationComponent } from './components/test-location/test-location.component'; @NgModule({ imports: [ @@ -25,7 +24,7 @@ import { TestLocationComponent } from './components/test-location/test-location. SharedFeatureModule, LocationModule ], - declarations: [SignupComponent, OtpComponent, SignupBasicInfoComponent, SignupOnboardingInfoComponent, SignupEmailPasswordComponent, TestLocationComponent], + declarations: [SignupComponent, OtpComponent, SignupBasicInfoComponent, SignupOnboardingInfoComponent, SignupEmailPasswordComponent], providers: [SignupService, LocationService] }) export class SignupModule { } diff --git a/src/app/client/src/app/modules/public/public-routing.module.ts b/src/app/client/src/app/modules/public/public-routing.module.ts index ae05e1d618d..3898d11dd4a 100644 --- a/src/app/client/src/app/modules/public/public-routing.module.ts +++ b/src/app/client/src/app/modules/public/public-routing.module.ts @@ -3,7 +3,6 @@ import { Routes, RouterModule } from '@angular/router'; import { LandingPageComponent } from './components'; import { LandingpageGuard } from './services'; import { OfflineApplicationDownloadComponent } from '@sunbird/shared'; -import { TestLocationComponent } from './module/signup/components/test-location/test-location.component'; const routes: Routes = [ { @@ -42,9 +41,7 @@ const routes: Routes = [ }, { path: 'guest-profile', loadChildren: () => import('./module/guest-profile/guest-profile.module').then(m => m.GuestProfileModule) - }, - { - path: 'test-location', component: TestLocationComponent, } + } ]; @NgModule({ imports: [RouterModule.forChild(routes)], diff --git a/src/app/helpers/whitelistApis.js b/src/app/helpers/whitelistApis.js index 883a4f31329..3772a308ff1 100644 --- a/src/app/helpers/whitelistApis.js +++ b/src/app/helpers/whitelistApis.js @@ -442,10 +442,10 @@ const API_LIST = { checksNeeded: ['ROLE_CHECK'], ROLE_CHECK: [ROLE.ALL] }, - // '/learner/user/v3/update': { - // checksNeeded: ['ROLE_CHECK'], - // ROLE_CHECK: [ROLE.PUBLIC] - // }, + '/learner/user/v3/update': { + checksNeeded: ['ROLE_CHECK'], + ROLE_CHECK: [ROLE.PUBLIC] + }, '/learner/user/v1/get': { checksNeeded: ['ROLE_CHECK'], ROLE_CHECK: [ROLE.PUBLIC] diff --git a/src/app/routes/clientRoutes.js b/src/app/routes/clientRoutes.js index c49c16b7e3f..20844fb29cf 100644 --- a/src/app/routes/clientRoutes.js +++ b/src/app/routes/clientRoutes.js @@ -121,7 +121,7 @@ module.exports = (app, keycloak) => { '/explore/*', '/:slug/explore', '/:slug/explore/*', '/exploren/*', '/:slug/exploren', '/:slug/exploren*', '/play/*', '/:slug/play/*', '/explore-course', '/explore-course/*', '/:slug/explore-course', '/:slug/explore-course/*', '/:slug/signup', '/signup', '/:slug/sign-in/*', '/sign-in/*', '/download/*', '/accountMerge/*','/:slug/accountMerge/*', '/:slug/download/*', '/certs/*', '/:slug/certs/*', '/recover/*', '/:slug/recover/*', '/explore-groups', - '/guest-profile', '/:slug/test-location', '/test-location',], + '/guest-profile'], session({ secret: envHelper.PORTAL_SESSION_SECRET_KEY, resave: false,