Skip to content

Commit

Permalink
fix: workflow empty state
Browse files Browse the repository at this point in the history
  • Loading branch information
radityaharya committed Apr 29, 2024
1 parent e46459d commit 2e3a230
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/app/api/user/[uid]/workflows/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function GET(
});

if (!workflows.length) {
return NextResponse.json("No workflows found", { status: 404 });
return NextResponse.json([], { status: 200 });
}

const res = workflows.map(
Expand Down
7 changes: 1 addition & 6 deletions src/lib/workflow/Workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,12 +436,7 @@ export class Runner extends Base {
}

const sources = workflow.operations.filter((operation) => {
return workflow.operations.some((otherOperation) => {
return (
otherOperation.sources?.includes(operation.id) &&
otherOperation.id !== operation.id
);
});
return !operation.sources || operation.sources.length === 0;
});

for (const source of sources) {
Expand Down

0 comments on commit 2e3a230

Please sign in to comment.