Skip to content

Commit 8399edc

Browse files
committed
Fixed optional id in todo
Signed-off-by: Omkar Phansopkar <[email protected]>
1 parent 95c11b2 commit 8399edc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/services/models/todo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { Sequelize, DataTypes, Model } from "sequelize";
1818
import { jsonDataType } from "./databaseUtils";
1919

2020
export interface TodoAttributes {
21-
id?: number;
21+
id: number;
2222
detection_id: string;
2323
issues: Record<string, string>;
2424
}

src/services/workbenchDB.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,9 @@ export class WorkbenchDB {
596596
// @TODO - ToDo in scans have a field review_comments, which is ideally an issue
597597
// It will be changed in the schema in future
598598
const todo: TodoAttributes[] = (rawTopLevelData.todo || []).map(
599-
(todo: RawTopLevelTodo) => {
599+
(todo: RawTopLevelTodo, idx) => {
600600
return {
601+
id: idx + 1,
601602
detection_id: todo.detection_id,
602603
issues: todo.review_comments,
603604
};

0 commit comments

Comments
 (0)