enzostvs HF Staff commited on
Commit
e084412
·
1 Parent(s): ea46297

rewrite function

Browse files
Files changed (1) hide show
  1. 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
- 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
 
 
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