@@ -117,10 +117,10 @@ export const fetchMemberTraits: any = () => async (dispatch: any) => {
117
117
if ( workExpValue ) {
118
118
// workExpValue is array of works. fill it to state
119
119
const works : WorkInfo [ ] = workExpValue . map ( ( j : any , index : number ) => {
120
- const startDate : Date | undefined = dateTimeToDate ( j . timePeriodFrom )
121
- const endDate : Date | undefined = dateTimeToDate ( j . timePeriodTo )
120
+ const startDate : Date | undefined = dateTimeToDate ( j . startDate )
121
+ const endDate : Date | undefined = dateTimeToDate ( j . endDate )
122
122
return ( {
123
- company : j . company ,
123
+ companyName : j . companyName ,
124
124
currentlyWorking : j . working ,
125
125
endDate,
126
126
id : index + 1 ,
@@ -142,10 +142,11 @@ export const fetchMemberTraits: any = () => async (dispatch: any) => {
142
142
const startDate : Date | undefined = dateTimeToDate ( e . timePeriodFrom )
143
143
const endDate : Date | undefined = dateTimeToDate ( e . timePeriodTo )
144
144
return ( {
145
- collegeName : e . schoolCollegeName ,
145
+ collegeName : e . collegeName ,
146
146
endDate,
147
147
id : index + 1 ,
148
- major : e . major ,
148
+ major : e . degree ,
149
+ endYear : e . endYear ,
149
150
startDate,
150
151
} )
151
152
} )
@@ -192,11 +193,11 @@ const createWorksPayloadData: any = (works: WorkInfo[]) => {
192
193
currentlyWorking,
193
194
} : any = work
194
195
return {
195
- company,
196
+ companyName : company || '' ,
196
197
industry,
197
198
position,
198
- timePeriodFrom : startDate ? startDate . toISOString ( ) : '' ,
199
- timePeriodTo : endDate ? endDate . toISOString ( ) : '' ,
199
+ startDate : startDate ? startDate . toISOString ( ) : null ,
200
+ endDate : endDate ? endDate . toISOString ( ) : null ,
200
201
working : currentlyWorking ,
201
202
}
202
203
} )
@@ -205,6 +206,7 @@ const createWorksPayloadData: any = (works: WorkInfo[]) => {
205
206
categoryName : UserTraitCategoryNames . work ,
206
207
traitId : UserTraitIds . work ,
207
208
traits : {
209
+ traitId : UserTraitIds . work ,
208
210
data,
209
211
} ,
210
212
}
@@ -242,21 +244,20 @@ const createEducationsPayloadData: any = (educations: EducationInfo[]) => {
242
244
const {
243
245
collegeName,
244
246
major,
245
- startDate,
246
- endDate,
247
+ endYear,
247
248
} : any = education
248
249
return {
249
- major,
250
- schoolCollegeName : collegeName ,
251
- timePeriodFrom : startDate ? startDate . toISOString ( ) : '' ,
252
- timePeriodTo : endDate ? endDate . toISOString ( ) : '' ,
250
+ degree : major ,
251
+ collegeName,
252
+ endYear : parseInt ( endYear , 10 ) ,
253
253
}
254
254
} )
255
255
256
256
const payload : any = {
257
257
categoryName : UserTraitCategoryNames . education ,
258
258
traitId : UserTraitIds . education ,
259
259
traits : {
260
+ traitId : UserTraitIds . education ,
260
261
data,
261
262
} ,
262
263
}
@@ -266,7 +267,7 @@ const createEducationsPayloadData: any = (educations: EducationInfo[]) => {
266
267
export const updateMemberEducations : any = ( educations : EducationInfo [ ] ) => async ( dispatch : any ) => {
267
268
try {
268
269
const tokenInfo : TokenModel = await getAsyncToken ( )
269
-
270
+ console . log ( createEducationsPayloadData ( educations ) , 'createEducationsPayloadData(educations)' )
270
271
await updateMemberTraits ( tokenInfo . handle || '' , createEducationsPayloadData ( educations ) )
271
272
dispatch ( updateEducations ( educations ) )
272
273
} catch ( error ) {
@@ -310,6 +311,7 @@ const createPersonalizationsPayloadData: any = (personalizations: Personalizatio
310
311
categoryName : UserTraitCategoryNames . personalization ,
311
312
traitId : UserTraitIds . personalization ,
312
313
traits : {
314
+ traitId : UserTraitIds . personalization ,
313
315
data,
314
316
} ,
315
317
}
0 commit comments