Skip to content

Commit

Permalink
fix ammo query
Browse files Browse the repository at this point in the history
  • Loading branch information
Razzmatazzz committed Jan 3, 2025
1 parent 2be6381 commit 50fd894
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions datasources/handbook.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ class HandbookAPI extends WorkerKV {
return cache.PlayerLevel;
}

async getAllItemProperties(context, info) {
const { cache } = await this.getCache(context, info);
return cache.ItemProperties;
}

async getItemProperties(context, info, itemId) {
const { cache } = await this.getCache(context, info);
return cache.ItemProperties[itemId];
Expand Down
3 changes: 2 additions & 1 deletion datasources/items.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,11 @@ class ItemsAPI extends WorkerKV {
// ignore bb
return ammoItems.filter(item => item.id !== '6241c316234b593b5676b637');
});
const itemProperties = await context.data.worker.handbook.getAllItemProperties(context, info);
return allAmmo.map(item => {
return {
...item,
...item.properties
...itemProperties[item.id],
};
});
}
Expand Down

0 comments on commit 50fd894

Please sign in to comment.