Skip to content

Commit d8fc98a

Browse files
ashokDevsclaude
andcommitted
fix: redirect to job page after prompt submission
The submit handler was ignoring the API response, so the user got no feedback. Now navigates to /jobs/{job_id} after successful submission. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4737e54 commit d8fc98a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

frontend/app/dashboard/page.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export default function Dashboard() {
9191

9292
setIsProcessing(true);
9393
try {
94-
await fetch("/api/jobs", {
94+
const res = await fetch("/api/jobs", {
9595
method: "POST",
9696
headers: { "Content-Type": "application/json" },
9797
body: JSON.stringify({
@@ -100,6 +100,10 @@ export default function Dashboard() {
100100
user_id: session.user.id
101101
})
102102
});
103+
const data = await res.json();
104+
if (data.job_id) {
105+
router.push(`/jobs/${data.job_id}`);
106+
}
103107
} finally {
104108
setIsProcessing(false);
105109
}

0 commit comments

Comments
 (0)