feat(blog) pagination

This commit is contained in:
lumither committed 2024-08-13 22:32:27 +08:00
1 parent 9f72bb01b7
commit eb7ea991ac
14 files changed
+219 -88

No files matched your search

+2 -8
View File
@@ -13,15 +13,9 @@ const NOCTURNE_ENDPOINT = ((isServerSide = true) => {
}
});
export async function fetchNocturneApi(path: string, isServerSideRequest = true): Promise<{ code: number, ret: any }> {
let res = await fetch(`${ NOCTURNE_ENDPOINT(isServerSideRequest) }${ path }`, {
export async function fetchNocturneApi(path: string, isServerSideRequest = true) {
return await fetch(`${ NOCTURNE_ENDPOINT(isServerSideRequest) }${ path }`, {
cache: 'no-cache'
});
if (!res.ok) {
return { code: res.status, ret: (await res.json()) };
}
return { code: res.status, ret: await res.json() };
}