feat: add table components and admin article list with skeleton loading
Some checks failed
Build and Test / run-test (20.x) (push) Failing after 1m30s
Some checks failed
Build and Test / run-test (20.x) (push) Failing after 1m30s
This commit is contained in:
@@ -10,6 +10,7 @@ import * as service from '@/lib/feature/article/article.service';
|
||||
import { getSessionData } from '@/lib/session/session-storage';
|
||||
import { TypedResult, wrap } from '@/utils/types/results';
|
||||
import { UUIDv4 } from '@/utils/types/uuid';
|
||||
import { revalidatePath } from 'next/cache';
|
||||
|
||||
export const getArticleByExternalId: (
|
||||
externalId: UUIDv4
|
||||
@@ -82,6 +83,7 @@ export const updateArticle: (
|
||||
|
||||
const result = await service.updateArticle(articleId, article);
|
||||
if (!result.ok) throw result.error;
|
||||
revalidatePath('/admin');
|
||||
return result.value;
|
||||
}
|
||||
);
|
||||
@@ -97,4 +99,5 @@ export const deleteArticle: (articleId: string) => Promise<TypedResult<void>> =
|
||||
|
||||
const result = await service.deleteArticle(articleId);
|
||||
if (!result.ok) throw result.error;
|
||||
revalidatePath('/admin');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user