Fix guild discovery

This commit is contained in:
Rory&
2026-04-19 23:19:56 +02:00
parent 1e06db149e
commit 69970cfa0e
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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",
+2 -2
View File
@@ -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({