mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-10-02 08:07:40 -05:00
Get all badges not just owned
This commit is contained in:
@@ -19,13 +19,9 @@ export function countsByUserId(userId: User["id"]) {
|
||||
return countsByUserIdStm.all({ userId }) as CountsByUserId;
|
||||
}
|
||||
|
||||
// xxx: make it so that it returns all badges not just owned
|
||||
const allWithAtLeastOneOwnerStm = sql.prepare(`
|
||||
select "Badge"."id", "Badge"."code", "Badge"."displayName"
|
||||
from "Badge"
|
||||
join "BadgeOwner" on "BadgeOwner"."badgeId" = "Badge"."id"
|
||||
group by "Badge"."id"
|
||||
having count("BadgeOwner"."userId") > 0
|
||||
`);
|
||||
|
||||
export type AllWithAtLeastOneOwner = Array<
|
||||
|
||||
Reference in New Issue
Block a user