feat: fallback to unsplash cover when article contains no image

This commit is contained in:
Max Richter
2025-11-09 23:52:53 +01:00
parent 6c6b69a46a
commit 655fc648e6
27 changed files with 687 additions and 224 deletions

View File

@@ -106,8 +106,11 @@ export async function createResource(
body: isJson ? JSON.stringify(content) : content,
});
if (!response.ok) {
const text = await response.text();
throw new Error(
`Failed to create resource (resources/${path}) : ${response.status}`,
`failed to create resource (resources/${path}): ${
text || response.status
}`,
);
}
return response.json();