Spaces:
Running
Running
fix(assistants): admins can see unfeatured assistants
Browse files
src/routes/assistants/+page.server.ts
CHANGED
@@ -34,11 +34,13 @@ export const load = async ({ url, locals }) => {
|
|
34 |
|
35 |
// if there is no user, we show community assistants, so only show featured assistants
|
36 |
const shouldBeFeatured =
|
37 |
-
env.REQUIRE_FEATURED_ASSISTANTS === "true" && !user
|
|
|
|
|
38 |
|
39 |
// if the user queried is not the current user, only show "public" assistants that have been shared before
|
40 |
const shouldHaveBeenShared =
|
41 |
-
env.REQUIRE_FEATURED_ASSISTANTS === "true" && !createdByCurrentUser
|
42 |
? { userCount: { $gt: 1 } }
|
43 |
: {};
|
44 |
|
|
|
34 |
|
35 |
// if there is no user, we show community assistants, so only show featured assistants
|
36 |
const shouldBeFeatured =
|
37 |
+
env.REQUIRE_FEATURED_ASSISTANTS === "true" && !user && !locals.user?.isAdmin
|
38 |
+
? { featured: true }
|
39 |
+
: {};
|
40 |
|
41 |
// if the user queried is not the current user, only show "public" assistants that have been shared before
|
42 |
const shouldHaveBeenShared =
|
43 |
+
env.REQUIRE_FEATURED_ASSISTANTS === "true" && !createdByCurrentUser && !locals.user?.isAdmin
|
44 |
? { userCount: { $gt: 1 } }
|
45 |
: {};
|
46 |
|