[F] Fix userbox

This commit is contained in:
Azalea
2024-12-17 20:36:01 -05:00
parent 637191836a
commit d854d8ae0b
2 changed files with 129 additions and 169 deletions

View File

@@ -266,7 +266,9 @@ export const USERBOX = {
get('/api/v2/game/chu3/user-box', {}),
getUnlockedItems: (itemId: UserBoxItemKind): Promise<{ itemKind: number, itemId: number, stock: number, isValid: boolean }[]> =>
get(`/api/v2/game/chu3/user-box-item-by-kind`,{ itemId }),
getItemLabels: () => get(`/api/v2/game/chu3/user-box-all-items`, {}),
getItemLabels: () => get(`/api/v2/game/chu3/user-box-all-items`, {}).then(it =>
Object.fromEntries(Object.entries(it).map(([key, value]) =>
[key, Object.fromEntries((value as any[]).map(it => [it.id, it.name]))]))),
setUserBox: (d: { field: string, value: number | string }) =>
post(`/api/v2/game/chu3/user-detail-set`, d),
}