Skip to content

Commit 681b2a0

Browse files
committed
chore: Add updated_at field to taskResult (#2653)
1 parent 3f4ace0 commit 681b2a0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/lib/services/answers.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export async function getAnswers(user_id: string) {
3232
export async function getAnswersWithSelectedTaskIds(
3333
selectedTaskIds: string[],
3434
userId: string,
35-
): Promise<Array<Pick<TaskAnswer, 'task_id' | 'user_id' | 'status_id'>>> {
35+
): Promise<Pick<TaskAnswer, 'task_id' | 'user_id' | 'status_id' | 'updated_at'>[]> {
3636
if (!selectedTaskIds?.length) {
3737
return [];
3838
}
@@ -46,6 +46,7 @@ export async function getAnswersWithSelectedTaskIds(
4646
task_id: true,
4747
user_id: true,
4848
status_id: true,
49+
updated_at: true,
4950
},
5051
});
5152
}

src/lib/services/task_results.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,10 @@ function mergeTaskAndAnswer(
260260
taskResult.submission_status_label_name = status.label_name;
261261
taskResult.is_ac = status.is_ac;
262262
taskResult.user_id = userId;
263+
264+
if (status.updated_at) {
265+
taskResult.updated_at = status.updated_at;
266+
}
263267
}
264268

265269
return taskResult;

0 commit comments

Comments
 (0)