[api] add creator filter to clothing search endpoint

This commit is contained in:
Devin Zuczek
2026-09-23 13:27:08 -04:00
parent 1b9984c72c
commit b172260cfd
3 changed files with 58 additions and 0 deletions
+13
View File
@@ -413,6 +413,13 @@ export interface CustomAvatarItemSearch {
* between them, never as a superset.
*/
includeCoachItems?: boolean
/**
* Only items this account authored — how the client lists what one player has made (a
* profile's creations, `creatorAccountId=<id>&includeCoachItems=False&take=1000`). Combines
* with the rest as one more AND; naming the Coach here with `includeCoachItems=false`
* matches nothing, as the two conditions read.
*/
creatorAccountId?: number
/** Lowest price to include, inclusive. */
minPrice?: number
/** Highest price to include, inclusive. */
@@ -447,6 +454,9 @@ export const SEARCH_MAX_TAKE = 200
* `True` and its user-generated-content tab sends `False`, and the two must not overlap — read
* as "stock plus players'", the storefront would show every player's item too.
*
* `creatorAccountId` narrows to one author. It was ignored until it was noticed that a player's
* creations list (which sends it) was serving the whole player-made catalog under every name.
*
* Ordered by recency because there is nothing else to order by — no purchase counts, no wear
* counts, no ratings are recorded — which is the same stand-in the `hot` feed makes. The
* `custom_avatar_item_id` tiebreak is what makes paging stable: without it, two items sharing a
@@ -489,6 +499,9 @@ export async function searchCustomAvatarItems(
} else if (search.includeCoachItems === false) {
where.push(`creator_account_id != ${bind(COACH_ACCOUNT_ID)}`)
}
if (search.creatorAccountId !== undefined) {
where.push(`creator_account_id = ${bind(search.creatorAccountId)}`)
}
if (search.minPrice !== undefined) where.push(`price >= ${bind(search.minPrice)}`)
if (search.maxPrice !== undefined) where.push(`price <= ${bind(search.maxPrice)}`)