enzostvs HF Staff commited on
Commit
0aedfd1
·
1 Parent(s): 3df25d0
Files changed (1) hide show
  1. app/api/collections/route.ts +7 -4
app/api/collections/route.ts CHANGED
@@ -19,7 +19,11 @@ export async function GET(request: Request) {
19
  orderBy: {
20
  id: 'desc'
21
  },
22
- where: {},
 
 
 
 
23
  take: 15,
24
  skip: page * 15
25
  }
@@ -33,11 +37,10 @@ export async function GET(request: Request) {
33
  equals: true
34
  }
35
  }
36
- }
37
- if (!is_admin) {
38
  query.where = {
39
  is_visible: {
40
- equals: true
41
  }
42
  }
43
  }
 
19
  orderBy: {
20
  id: 'desc'
21
  },
22
+ where: {
23
+ is_visible: {
24
+ equals: true
25
+ }
26
+ },
27
  take: 15,
28
  skip: page * 15
29
  }
 
37
  equals: true
38
  }
39
  }
40
+ } else if (is_admin) {
 
41
  query.where = {
42
  is_visible: {
43
+ equals: false
44
  }
45
  }
46
  }