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:
@@ -99,7 +99,8 @@ export default async function JobsPage({ searchParams }: { searchParams: Promise
|
|||||||
try {
|
try {
|
||||||
result = await startMetadataRefresh(libraryId);
|
result = await startMetadataRefresh(libraryId);
|
||||||
} catch {
|
} catch {
|
||||||
return;
|
revalidatePath("/jobs");
|
||||||
|
redirect("/jobs");
|
||||||
}
|
}
|
||||||
revalidatePath("/jobs");
|
revalidatePath("/jobs");
|
||||||
redirect(`/jobs?highlight=${result.id}`);
|
redirect(`/jobs?highlight=${result.id}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user