fix: redirect instead of silent return when metadata refresh fails

When the API returns an error (e.g. no approved links for ongoing series),
the catch block was silently returning undefined from the server action,
making the button appear frozen with no feedback to the user.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-26 08:02:02 +01:00
parent 66d0a9f56d
commit d103dc20df

View File

@@ -99,7 +99,8 @@ export default async function JobsPage({ searchParams }: { searchParams: Promise
try {
result = await startMetadataRefresh(libraryId);
} catch {
return;
revalidatePath("/jobs");
redirect("/jobs");
}
revalidatePath("/jobs");
redirect(`/jobs?highlight=${result.id}`);