Spaces:
Runtime error
Runtime error
infinite loading
Browse files
app/api/collections/route.ts
CHANGED
@@ -38,7 +38,7 @@ export async function GET(request: Request) {
|
|
38 |
collections,
|
39 |
pagination: {
|
40 |
total,
|
41 |
-
page
|
42 |
total_pages: Math.ceil(total / 15)
|
43 |
},
|
44 |
status: 200,
|
|
|
38 |
collections,
|
39 |
pagination: {
|
40 |
total,
|
41 |
+
page,
|
42 |
total_pages: Math.ceil(total / 15)
|
43 |
},
|
44 |
status: 200,
|
components/main/hooks/useCollections.ts
CHANGED
@@ -51,7 +51,7 @@ export const useCollections = (category: string) => {
|
|
51 |
setLoading(true);
|
52 |
const queryParams = new URLSearchParams();
|
53 |
queryParams.append('userId', category === 'my-own' ? user?.sub : undefined);
|
54 |
-
queryParams.append('page', data?.pagination?.page
|
55 |
|
56 |
const response = await fetch(`/api/collections?${queryParams.toString()}`, {
|
57 |
headers: {
|
|
|
51 |
setLoading(true);
|
52 |
const queryParams = new URLSearchParams();
|
53 |
queryParams.append('userId', category === 'my-own' ? user?.sub : undefined);
|
54 |
+
queryParams.append('page', data?.pagination?.page + 1);
|
55 |
|
56 |
const response = await fetch(`/api/collections?${queryParams.toString()}`, {
|
57 |
headers: {
|
utils/checker/is_admin.ts
CHANGED
@@ -9,7 +9,7 @@ export const isAdmin = async (headers: Headers) => {
|
|
9 |
const userRequest = await fetch("https://huggingface.co/oauth/userinfo", {
|
10 |
method: "GET",
|
11 |
headers: {
|
12 |
-
Authorization:
|
13 |
},
|
14 |
})
|
15 |
|
|
|
9 |
const userRequest = await fetch("https://huggingface.co/oauth/userinfo", {
|
10 |
method: "GET",
|
11 |
headers: {
|
12 |
+
Authorization: `${Authorization}`,
|
13 |
},
|
14 |
})
|
15 |
|