Skip to content

Commit d9aa912

Browse files
committed
added a missing check for task in POST Model
1 parent 73b93b9 commit d9aa912

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

models/progresses.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ const createProgressDocument = async (progressData) => {
2828
const progressDateTimestamp = isBefore6amIST
2929
? new Date().setUTCHours(0, 0, 0, 0) - MILLISECONDS_IN_DAY
3030
: new Date().setUTCHours(0, 0, 0, 0);
31-
32-
await assertTaskExists(taskId);
31+
if (taskId) {
32+
await assertTaskExists(taskId);
33+
}
3334
const query = buildQueryForPostingProgress(progressData);
3435
const existingDocumentSnapshot = await query.where("date", "==", progressDateTimestamp).get();
3536
if (!existingDocumentSnapshot.empty) {

0 commit comments

Comments
 (0)