Skip to content

Commit 567484a

Browse files
committed
Adding na to the forward sync part
1 parent 9e17375 commit 567484a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
export default checkpointScoreMapper =
2-
({uuid, score, remarks, checkpoint}) =>
2+
({uuid, score, remarks, checkpoint, na}) =>
33
Object.assign({
44
uuid: uuid,
55
score: score,
66
remarks: remarks,
7-
checkpoint: checkpoint
7+
checkpoint: checkpoint,
8+
na: na
89
});

src/js/service/ChecklistService.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,13 @@ class ChecklistService extends BaseService {
136136
}
137137

138138
getCheckpointScoresFor(checklistUUID, assessmentUUID) {
139-
return this.db.objects(CheckpointScore.schema.name)
139+
const filledCheckpoints = this.db.objects(CheckpointScore.schema.name)
140140
.filtered("score != null AND checklist = $0 AND facilityAssessment = $1", checklistUUID, assessmentUUID)
141141
.map((checkpointScore) => Object.assign({}, checkpointScore));
142+
const naCheckpoints = this.db.objects(CheckpointScore.schema.name)
143+
.filtered("na = true AND checklist = $0 AND facilityAssessment = $1", checklistUUID, assessmentUUID)
144+
.map((checkpointScore) => Object.assign({}, checkpointScore));
145+
return filledCheckpoints.concat(naCheckpoints);
142146
}
143147

144148
markCheckpointScoresSubmitted(checkpointScores) {

0 commit comments

Comments
 (0)