Skip to content

Commit 657f098

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

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/libs/db2/model/plansnapshot.js

Lines changed: 5 additions & 4 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,13 @@ export default class PlanSnapshot extends Model {
153153
}
154154
}
155155
}
156-
const responseReversed = response.reverse();
157-
const currentLegalVersion = responseReversed.find(
156+
const responseSorted = response.reverse();
157+
158+
const currentLegalVersion = responseSorted.find(
158159
(resp) => Plan.legalStatuses.indexOf(resp.snapshot.statusId) !== -1,
159160
);
160161
if (currentLegalVersion) currentLegalVersion.isCurrentLegalVersion = true;
161-
return responseReversed;
162+
return responseSorted;
162163
}
163164

164165
async fetchStatus(db) {

0 commit comments

Comments
 (0)