Skip to content

Commit 2603e24

Browse files
fix: issue in hasNodes issue
1 parent e7bcce4 commit 2603e24

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

app/src/routes/codeOperations.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ codeOperationsRouter.post('/generate', requireEmailMiddleware, async (request, r
5454
}
5555

5656
const hasNodes = (entity: ProjectEntity) => {
57-
return !entity.json
58-
|| entity.json === '{}'
59-
|| entity.json.length === 0
60-
|| !JSON.parse(entity.json)?.nodes
61-
|| JSON.parse(entity.json)?.nodes?.length !== 0;
57+
return entity.json
58+
&& entity.json !== '{}'
59+
&& entity.json.length !== 0
60+
&& JSON.parse(entity.json).nodes
61+
&& Object.keys(JSON.parse(entity.json).nodes).length !== 0;
6262
};
6363

6464
if (!hasNodes(projectEntity)) {

0 commit comments

Comments
 (0)