@@ -73,82 +73,17 @@ export function getProjectMembers(projectId) {
7373 + encodeURIComponent ( fields )
7474 return axios . get ( url )
7575 . then ( resp => {
76- return populateUserDetails ( resp . data . result . content )
76+ return resp . data . result . content
7777 } )
7878}
7979
80- // temporary fix to populate data which is not returned at the moment by Member Service
81- const userDetails = {
82- 40152856 : {
83- handle : 'pshah_manager' ,
84- firstName : 'Parth121' ,
85- lastName : 'Manager1' ,
86- photoUrl : 'https://topcoder-dev-media.s3.amazonaws.com/member/profile/pshah_manager-1565325063054.jpeg' ,
87- timeZone : 'America/Chicago' ,
88- workingHourStart : '9:00' ,
89- workingHourEnd : '18:00'
90- } ,
91- 40152922 : {
92- photoURL : 'https://topcoder-dev-media.s3.amazonaws.com/member/profile/pshah_customer-1552561016111.png' ,
93- handle : 'pshah_customer' ,
94- firstName : 'Parth' ,
95- lastName : 'Customer' ,
96- timeZone : 'Asia/Kolkata' ,
97- workingHourStart : '15:00' ,
98- workingHourEnd : '24:00'
99- } ,
100- 40154389 : {
101- handle : 'bruce13' ,
102- firstName : 'Rishi Raj' ,
103- lastName : 'Sahu' ,
104- photoURL : 'https://topcoder-dev-media.s3.amazonaws.com/member/profile/bruce13-1531204784385.jpeg' ,
105- timeZone : 'Asia/Kolkata' ,
106- workingHourStart : null ,
107- workingHourEnd : null
108- } ,
109- 40153891 : {
110- handle : 'maxceem-dev' ,
111- firstName : 'Maksym1' ,
112- lastName : 'Dev' ,
113- photoURL : 'https://topcoder-dev-media.s3.amazonaws.com/member/profile/maxceem-dev-1541129349761.jpeg' ,
114- timeZone : null ,
115- workingHourStart : null ,
116- workingHourEnd : null
117- } ,
118- 40035291 : {
119- handle : 'maxceem' ,
120- firstName : 'F_NAME' ,
121- lastName : 'L_NAME' ,
122- photoURL : 'https://topcoder-dev-media.s3.amazonaws.com/member/profile/maxceem-1541153638241.jpeg' ,
123- timeZone : null ,
124- workingHourStart : null ,
125- workingHourEnd : null
126- }
127- }
128-
129- const populateUserDetails = ( list ) => {
130- if ( ! list ) {
131- return list
132- }
133-
134- return _ . map ( list , ( item ) => {
135- // if item didn't get data from Member Service, but we have mocked data for it
136- // then populate our mock data
137- if ( ! item . handle && userDetails [ item . userId ] ) {
138- return { ...item , ...userDetails [ item . userId ] }
139- }
140-
141- return item
142- } )
143- }
144-
14580export function getProjectMemberInvites ( projectId ) {
14681 const fields = 'id,projectId,userId,email,role,status,createdAt,updatedAt,createdBy,updatedBy,handle,firstName,lastName,photoURL'
14782 const url = `${ PROJECTS_API_URL } /v4/projects/${ projectId } /members/invites/?fields=`
14883 + encodeURIComponent ( fields )
14984 return axios . get ( url )
15085 . then ( resp => {
151- return populateUserDetails ( resp . data . result . content )
86+ return resp . data . result . content
15287 } )
15388}
15489
@@ -158,6 +93,6 @@ export function getProjectMember(projectId, memberId) {
15893 + encodeURIComponent ( fields )
15994 return axios . get ( url )
16095 . then ( resp => {
161- return ( populateUserDetails ( [ resp . data . result . content ] ) ) [ 0 ]
96+ return resp . data . result . content
16297 } )
16398}
0 commit comments