Spaces:
Runtime error
Runtime error
rewrite function
Browse files- app/api/collections/route.ts +16 -16
app/api/collections/route.ts
CHANGED
@@ -28,22 +28,22 @@ export async function GET(request: Request) {
|
|
28 |
skip: page * 15
|
29 |
}
|
30 |
|
31 |
-
if (userId) {
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
} else if (is_admin) {
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
}
|
47 |
|
48 |
const collections = await prisma.collection.findMany(query)
|
49 |
|
|
|
28 |
skip: page * 15
|
29 |
}
|
30 |
|
31 |
+
// if (userId) {
|
32 |
+
// query.where = {
|
33 |
+
// userId: {
|
34 |
+
// equals: userId
|
35 |
+
// },
|
36 |
+
// is_visible: {
|
37 |
+
// equals: true
|
38 |
+
// }
|
39 |
+
// }
|
40 |
+
// } else if (is_admin) {
|
41 |
+
// query.where = {
|
42 |
+
// is_visible: {
|
43 |
+
// equals: undefined
|
44 |
+
// }
|
45 |
+
// }
|
46 |
+
// }
|
47 |
|
48 |
const collections = await prisma.collection.findMany(query)
|
49 |
|