diff --git a/src/services/models/todo.ts b/src/services/models/todo.ts index f88a6e77..c28a98b5 100644 --- a/src/services/models/todo.ts +++ b/src/services/models/todo.ts @@ -18,7 +18,7 @@ import { Sequelize, DataTypes, Model } from "sequelize"; import { jsonDataType } from "./databaseUtils"; export interface TodoAttributes { - id?: number; + id: number; detection_id: string; issues: Record; } diff --git a/src/services/workbenchDB.ts b/src/services/workbenchDB.ts index b8d2bf2c..c2acbed3 100644 --- a/src/services/workbenchDB.ts +++ b/src/services/workbenchDB.ts @@ -596,8 +596,9 @@ export class WorkbenchDB { // @TODO - ToDo in scans have a field review_comments, which is ideally an issue // It will be changed in the schema in future const todo: TodoAttributes[] = (rawTopLevelData.todo || []).map( - (todo: RawTopLevelTodo) => { + (todo: RawTopLevelTodo, idx) => { return { + id: idx + 1, detection_id: todo.detection_id, issues: todo.review_comments, };