feat(community/posts): ?userId= query filter
Foreign-Profile-Page rendert User-Posts jetzt via PostCard mit dem gleichen Daten-Shape wie Index. `?userId=<uuid>` filtert auf Posts dieses Users — kombinierbar mit `category=...`, Bot-Kategorie-Mapping wird übersteuert wenn explizite userId mitgegeben. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
bca00e03a5
commit
3c73a8b44a
@ -10,11 +10,17 @@ export default defineEventHandler(async (event) => {
|
|||||||
const category = (query.category as string) || "all";
|
const category = (query.category as string) || "all";
|
||||||
const page = Math.max(1, parseInt((query.page as string) || "1"));
|
const page = Math.max(1, parseInt((query.page as string) || "1"));
|
||||||
const limit = Math.min(50, parseInt((query.limit as string) || "20"));
|
const limit = Math.min(50, parseInt((query.limit as string) || "20"));
|
||||||
|
const userIdParam = (query.userId as string) || null;
|
||||||
|
|
||||||
// Lyra / ReBreak → nach userId filtern
|
// Lyra / ReBreak → nach userId filtern; expliziter userIdParam hat Vorrang
|
||||||
let filterUserId: string | null = null;
|
let filterUserId: string | null = userIdParam;
|
||||||
let dbCategory = category;
|
let dbCategory = category;
|
||||||
if (category === "lyra") {
|
if (userIdParam) {
|
||||||
|
// Explizite userId: Bot-Kategorie-Mapping irrelevant, category-Filter weglassen außer echte Kategorien
|
||||||
|
if (category === "lyra" || category === "rebreak") {
|
||||||
|
dbCategory = "all";
|
||||||
|
}
|
||||||
|
} else if (category === "lyra") {
|
||||||
filterUserId = lyraBotUserId;
|
filterUserId = lyraBotUserId;
|
||||||
dbCategory = "all";
|
dbCategory = "all";
|
||||||
} else if (category === "rebreak") {
|
} else if (category === "rebreak") {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user