Skip to content

Commit

Permalink
Fix validation error when editing top level collections
Browse files Browse the repository at this point in the history
  • Loading branch information
mmahdigh committed Oct 23, 2023
1 parent 0a29be7 commit 6c43d81
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/flow/flow.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1037,8 +1037,9 @@ export class FlowService {
) => {
const valid = await Promise.all(
data.map(async (list) => {
const listId = list.id === -1 ? null : list.id;
const numOfChildren = await this.prismaService.project.count({
where: { parentId: list.id },
where: { parentId: listId },
});

if (
Expand All @@ -1056,7 +1057,7 @@ export class FlowService {
where: { id: el.id },
});

return res?.parentId === list.id;
return res?.parentId === listId;
}),
);

Expand Down

0 comments on commit 6c43d81

Please sign in to comment.