Skip to content

Commit 522b8e1

Browse files
author
Brijesh
committed
remove status 21 from the list to identify amendment approver
1 parent 0015a19 commit 522b8e1

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/libs/db2/model/plansnapshot.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export default class PlanSnapshot extends Model {
143143
snapshot: row.snapshot,
144144
});
145145
}
146-
if (Plan.legalStatuses.indexOf(row.status_id) !== -1) {
146+
if ([20, 8, 9, 12].indexOf(row.status_id) !== -1) {
147147
if (lastMandatoryAmendment !== null) {
148148
response[lastMandatoryAmendment].approvedBy = `${row.given_name} ${row.family_name}`;
149149
response[lastMandatoryAmendment].approvedAt = row.created_at;
@@ -153,12 +153,11 @@ export default class PlanSnapshot extends Model {
153153
}
154154
}
155155
}
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);
160159
if (currentLegalVersion) currentLegalVersion.isCurrentLegalVersion = true;
161-
return responseReversed;
160+
return responseSorted;
162161
}
163162

164163
async fetchStatus(db) {

0 commit comments

Comments
 (0)