feat: wrap article and user service functions with TypedResult for improved error handling
This commit is contained in:
@@ -70,7 +70,9 @@ const ArticleContentSkeleton = () => (
|
||||
|
||||
const ArticleContent = async ({ params }: ArticleContentProps) => {
|
||||
const { slug } = await params;
|
||||
const article = await getArticleBySlug(slug);
|
||||
const articleResult = await getArticleBySlug(slug);
|
||||
if (!articleResult.ok) throw articleResult.error;
|
||||
const article = articleResult.value;
|
||||
|
||||
if (!article) notFound();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user