mirror of
https://github.com/Lumither/nocturne.git
synced 2026-10-17 10:26:21 +00:00
feat(blog) pagination
This commit is contained in:
14 files changed
+219
-88
No files matched your search
@@ -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() };
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user