Skip to content

Commit

Permalink
updated frontend accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
bigabig committed Sep 30, 2024
1 parent 9ded38d commit 2cd8dad
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/Code/CodeCreateDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function CodeCreateDialog() {
control,
} = useForm<CodeCreateValues>({
defaultValues: {
parentCodeId: -1,
parentCodeId: undefined,
name: "",
color: "#000000",
description: "",
Expand Down Expand Up @@ -101,7 +101,7 @@ function CodeCreateDialog() {
description: data.description,
color: data.color,
project_id: parseInt(projectId),
parent_id: pcid,
parent_id: pcid === -1 ? null : pcid,
is_system: false,
},
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Code/CodeEditDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function CodeEditDialog({ codes }: CodeEditDialogProps) {
...requestBody,
name: data.name,
description: data.description,
parent_id: data.parentCodeId,
parent_id: data.parentCodeId === -1 ? null : data.parentCodeId,
};
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Tag/TagCreateDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function TagCreateDialog() {
name: data.name,
description: data.description || "",
color: data.color,
parent_id: data.parent_id,
parent_id: data.parent_id === -1 ? null : data.parent_id,
project_id: projectId,
},
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Tag/TagEditDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function TagEditDialog({ tags }: TagEditDialogProps) {
name: data.name,
description: data.description,
color: data.color,
parent_id: data.parent_id,
parent_id: data.parent_id === -1 ? null : data.parent_id,
},
tagId: tag.data.id,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const DatabaseEdgeEditMenu = forwardRef<DatabaseEdgeEditMenuHandle, DatabaseEdge
{
codeId: sourceNode.data.codeId,
requestBody: {
parent_id: -1,
parent_id: null,
},
},
{
Expand Down

0 comments on commit 2cd8dad

Please sign in to comment.