fix(shared): tag filter SQL precedence, balance cards filter by tag

This commit is contained in:
2026-03-14 21:30:33 +11:00
parent 02ac136e19
commit d53d3106f2
4 changed files with 27 additions and 14 deletions
+3 -1
View File
@@ -6,6 +6,8 @@ export async function GET(req: NextRequest) {
const user = await getCurrentUser(req);
if (!user) return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
const balances = await getParticipantBalances(user.id);
const tagParam = req.nextUrl.searchParams.get("tag_ids");
const tagIds = tagParam ? tagParam.split(",").map(Number).filter(Boolean) : undefined;
const balances = await getParticipantBalances(user.id, tagIds);
return NextResponse.json(balances);
}