Skip to content

Commit

Permalink
Fixed optional id in todo
Browse files Browse the repository at this point in the history
Signed-off-by: Omkar Phansopkar <[email protected]>
  • Loading branch information
OmkarPh committed Feb 14, 2024
1 parent 95c11b2 commit 8399edc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/services/models/todo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string>;
}
Expand Down
3 changes: 2 additions & 1 deletion src/services/workbenchDB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down

0 comments on commit 8399edc

Please sign in to comment.