File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ export default class PlanSnapshot extends Model {
143
143
snapshot : row . snapshot ,
144
144
} ) ;
145
145
}
146
- if ( Plan . legalStatuses . indexOf ( row . status_id ) !== - 1 ) {
146
+ if ( [ 20 , 8 , 9 , 12 ] . indexOf ( row . status_id ) !== - 1 ) {
147
147
if ( lastMandatoryAmendment !== null ) {
148
148
response [ lastMandatoryAmendment ] . approvedBy = `${ row . given_name } ${ row . family_name } ` ;
149
149
response [ lastMandatoryAmendment ] . approvedAt = row . created_at ;
@@ -153,12 +153,11 @@ export default class PlanSnapshot extends Model {
153
153
}
154
154
}
155
155
}
156
- const responseReversed = response . reverse ( ) ;
157
- const currentLegalVersion = responseReversed . find (
158
- ( resp ) => Plan . legalStatuses . indexOf ( resp . snapshot . statusId ) !== - 1 ,
159
- ) ;
156
+ const responseSorted = response . reverse ( ) ;
157
+
158
+ const currentLegalVersion = responseSorted . find ( ( resp ) => [ 9 , 12 ] . indexOf ( resp . snapshot . statusId ) !== - 1 ) ;
160
159
if ( currentLegalVersion ) currentLegalVersion . isCurrentLegalVersion = true ;
161
- return responseReversed ;
160
+ return responseSorted ;
162
161
}
163
162
164
163
async fetchStatus ( db ) {
You can’t perform that action at this time.
0 commit comments