summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-04-19 23:19:56 +0200
committerRory& <root@rory.gay>2026-04-19 23:19:56 +0200
commit69970cfa0ebc8da9d3ca10b64656eb94ee6d6595 (patch)
tree5e50fb7a168cc28e11701433a56d113aca0e995d
parentUpdate readme (diff)
downloadserver-ts-69970cfa0ebc8da9d3ca10b64656eb94ee6d6595.tar.xz
Fix guild discovery
-rw-r--r--src/api/routes/discoverable-guilds.ts4
-rw-r--r--src/api/routes/guild-recommendations.ts4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/api/routes/discoverable-guilds.ts b/src/api/routes/discoverable-guilds.ts

index 2df44c16..4db31a09 100644 --- a/src/api/routes/discoverable-guilds.ts +++ b/src/api/routes/discoverable-guilds.ts
@@ -20,7 +20,7 @@ import { Config, Guild, Member } from "@spacebar/util"; import { route } from "@spacebar/api"; import { Request, Response, Router } from "express"; -import { In, Like, Not } from "typeorm"; +import { ArrayContains, In, Like, Not } from "typeorm"; import { DiscoverableGuildsResponse } from "@spacebar/schemas"; const router = Router({ mergeParams: true }); @@ -51,7 +51,7 @@ router.get( id: Not(In(hiddenGuildIds)), discovery_excluded: false, ...(categories == undefined ? {} : { primary_category_id: categories.toString() }), // TODO: isnt this an array? - ...(showAllGuilds ? {} : { features: Like("%DISCOVERABLE%") }), + ...(showAllGuilds ? {} : { features: ArrayContains(["DISCOVERABLE"]) }), }, order: { discovery_weight: "DESC", diff --git a/src/api/routes/guild-recommendations.ts b/src/api/routes/guild-recommendations.ts
index 37ce779e..42edd29b 100644 --- a/src/api/routes/guild-recommendations.ts +++ b/src/api/routes/guild-recommendations.ts
@@ -20,7 +20,7 @@ import { Config, Guild } from "@spacebar/util"; import { route } from "@spacebar/api"; import { Request, Response, Router } from "express"; -import { Like } from "typeorm"; +import { ArrayContains, Like } from "typeorm"; const router = Router({ mergeParams: true }); @@ -44,7 +44,7 @@ router.get( const guilds = showAllGuilds ? await Guild.find({ take: Math.abs(Number(limit || 24)) }) : await Guild.find({ - where: { features: Like("%DISCOVERABLE%") }, + where: { features: ArrayContains(["DISCOVERABLE"]) }, take: Math.abs(Number(limit || 24)), }); res.send({