Skip to content

Commit

Permalink
Merge pull request #409 from sunbird-cb/dev-portal
Browse files Browse the repository at this point in the history
Dev portal
  • Loading branch information
christyfernandes authored May 17, 2022
2 parents edba195 + 10a54f8 commit 928254a
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import _ from 'lodash'

const API_END_POINTS = {
// getUserdetailsV2FromRegistry: '/apis/protected/v8/user/profileRegistry/getUserRegistryByUser',
getUserdetailsV2FromRegistry: '/apis/proxies/v8/api/user/v2/read',
getUserdetailsV2FromRegistry: '/apis/proxies/v8/api/user/v5/read',
}

@Injectable({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ export class AppTocHomeComponent implements OnInit, OnDestroy, AfterViewChecked,
if (this.content && this.content.identifier && this.content.primaryCategory) {
this.ratingSvc.getRating(this.content.identifier, this.content.primaryCategory, this.userId).subscribe(
(res: any) => {
this.userRating = res.result.response[0]
this.userRating = res.result.response
this.tocSvc.changeUpdateReviews(true)
// this.userRating = {
// commentupdatedon: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const API_ENDPOINTS = {
searchCompetency: 'apis/protected/v8/frac/searchNodes',
filterByMappings: 'apis/protected/v8/frac/filterByMappings',
// searchCompetency: '/apis/protected/v8/competency/searchCompetency',
fetchProfileNyId: (id: string) => `/apis/proxies/v8/api/user/v2/read/${id}`,
fetchProfileNyId: (id: string) => `/apis/proxies/v8/api/user/v5/read/${id}`,
// fetchProfile: '/apis/protected/v8/user/profileDetails/getUserRegistry',
fetchCompetencyDetails: (id: string, type: string) => `/apis/protected/v8/frac/getNodeById/${id}/${type}`,
fetchProfile: '/apis/proxies/v8/api/user/v2/read',
fetchProfile: '/apis/proxies/v8/api/user/v5/read',
updateProfile: '/apis/protected/v8/user/profileDetails/updateUser',
fetchWatCompetency: (id: string) => `/apis/protected/v8/workallocation/getUserCompetencies/${id}`,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import _ from 'lodash'

const API_END_POINTS = {
// getUserdetailsV2FromRegistry: '/apis/protected/v8/user/profileRegistry/getUserRegistryByUser',
getUserdetailsV2FromRegistry: '/apis/proxies/v8/api/user/v2/read',
getUserdetailsV2FromRegistry: '/apis/proxies/v8/api/user/v5/read',
}

@Injectable({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const API_ENDPOINTS = {
connectionEstablished: `/apis/protected/v8/connections/v2/connections/established`,
getSuggestedUsers: `/apis/protected/v8/connections/v2/connections/suggests`,
// getUserdetailsV2FromRegistry: '/apis/protected/v8/user/profileRegistry/getUserRegistryByUser',
getUserdetailsV2FromRegistry: '/apis/proxies/v8/api/user/v2/read',
getUserdetailsV2FromRegistry: '/apis/proxies/v8/api/user/v5/read',
}

@Injectable({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const API_END_POINTS = {
PROFILE_DETAIL: `${PROTECTED_SLAG_V8}/social/post/timeline`,
SOCIAL_VIEW_CONVERSATION: `${PROTECTED_SLAG_V8}/social/post/viewConversation`,
// getUserdetailsV2FromRegistry: '/apis/protected/v8/user/profileRegistry/getUserRegistryByUser',
getUserdetailsV2FromRegistry: '/apis/proxies/v8/api/user/v2/read',
getUserdetailsV2FromRegistry: '/apis/proxies/v8/api/user/v5/read',
}

@Injectable({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { map } from 'rxjs/operators'

const API_ENDPOINTS = {
updateProfileDetails: '/apis/protected/v8/user/profileDetails/updateUser',
getUserdetailsFromRegistry: '/apis/proxies/v8/api/user/v2/read',
getUserdetailsFromRegistry: '/apis/proxies/v8/api/user/v5/read',
getUserdetails: '/apis/protected/v8/user/details/detailV1',
getMasterNationlity: '/apis/protected/v8/user/profileRegistry/getMasterNationalities',
getMasterLanguages: '/apis/protected/v8/user/profileRegistry/getMasterLanguages',
Expand Down
9 changes: 6 additions & 3 deletions src/app/services/init.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ interface IFeaturePermissionConfigs {
const PROXY_CREATE_V8 = '/apis/proxies/v8'

const endpoint = {
profilePid: '/apis/proxies/v8/api/user/v2/read',
profilePid: '/apis/proxies/v8/api/user/v5/read',
// profileV2: '/apis/protected/v8/user/profileRegistry/getUserRegistryById',
// details: `/apis/protected/v8/user/details?ts=${Date.now()}`,
CREATE_USER_API: `${PROXY_CREATE_V8}/discussion/user/v1/create`,
Expand Down Expand Up @@ -259,8 +259,11 @@ export class InitService {
try {
userPidProfile = await this.http
.get<any>(endpoint.profilePid)
.pipe(map((res: any) => res.result.response))
.toPromise()
.pipe(map((res: any) => {
const roles = _.map(_.get(res, 'result.response.roles'), 'role')
_.set(res, 'result.response.roles', roles)
return _.get(res, 'result.response')
})).toPromise()
if (userPidProfile && userPidProfile.roles && userPidProfile.roles.length > 0 &&
this.hasRole(userPidProfile.roles)) {
// if (userPidProfile.result.response.organisations.length > 0) {
Expand Down

0 comments on commit 928254a

Please sign in to comment.