Skip to content

Commit 69970cf

Browse files
Fix guild discovery
1 parent 1e06db1 commit 69970cf

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/api/routes/discoverable-guilds.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { Config, Guild, Member } from "@spacebar/util";
2020

2121
import { route } from "@spacebar/api";
2222
import { Request, Response, Router } from "express";
23-
import { In, Like, Not } from "typeorm";
23+
import { ArrayContains, In, Like, Not } from "typeorm";
2424
import { DiscoverableGuildsResponse } from "@spacebar/schemas";
2525

2626
const router = Router({ mergeParams: true });
@@ -51,7 +51,7 @@ router.get(
5151
id: Not(In(hiddenGuildIds)),
5252
discovery_excluded: false,
5353
...(categories == undefined ? {} : { primary_category_id: categories.toString() }), // TODO: isnt this an array?
54-
...(showAllGuilds ? {} : { features: Like("%DISCOVERABLE%") }),
54+
...(showAllGuilds ? {} : { features: ArrayContains(["DISCOVERABLE"]) }),
5555
},
5656
order: {
5757
discovery_weight: "DESC",

src/api/routes/guild-recommendations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { Config, Guild } from "@spacebar/util";
2020

2121
import { route } from "@spacebar/api";
2222
import { Request, Response, Router } from "express";
23-
import { Like } from "typeorm";
23+
import { ArrayContains, Like } from "typeorm";
2424

2525
const router = Router({ mergeParams: true });
2626

@@ -44,7 +44,7 @@ router.get(
4444
const guilds = showAllGuilds
4545
? await Guild.find({ take: Math.abs(Number(limit || 24)) })
4646
: await Guild.find({
47-
where: { features: Like("%DISCOVERABLE%") },
47+
where: { features: ArrayContains(["DISCOVERABLE"]) },
4848
take: Math.abs(Number(limit || 24)),
4949
});
5050
res.send({

0 commit comments

Comments
 (0)