File tree 1 file changed +20
-2
lines changed
1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,22 @@ export function normalizeChallenges(challenges) {
22
22
}
23
23
return challenges ;
24
24
}
25
+
26
+ /**
27
+ * Sync the fields of V3 and V5 for front-end to process successfully
28
+ * @param challenge - challenge to normalize
29
+ */
30
+ function normalizeChallengePhases ( challenge ) {
31
+ return {
32
+ ...challenge ,
33
+ phases : _ . map ( challenge . phases , phase => ( {
34
+ ...phase ,
35
+ scheduledStartDate : phase . scheduledStartTime ,
36
+ scheduledEndDate : phase . scheduledEndTime ,
37
+ } ) ) ,
38
+ } ;
39
+ }
40
+
25
41
/**
26
42
* Service class.
27
43
*/
@@ -64,8 +80,10 @@ class ReviewOpportunitiesService {
64
80
. then ( res => res . json ( ) )
65
81
. then ( res => (
66
82
res . result . status === 200
67
- ? res . result . content
68
- : Promise . reject ( res . result )
83
+ ? {
84
+ ...res . result . content ,
85
+ challenge : normalizeChallengePhases ( res . result . content . challenge ) ,
86
+ } : Promise . reject ( res . result )
69
87
) ) ;
70
88
}
71
89
You can’t perform that action at this time.
0 commit comments