diff options
author | mat <github@matdoes.dev> | 2022-05-16 17:58:15 +0000 |
---|---|---|
committer | mat <github@matdoes.dev> | 2022-05-16 17:58:15 +0000 |
commit | ed72217fd73eca1de929f915056e13be9d4085f9 (patch) | |
tree | 1627dbffb63064697c9a6fac263b7948ba07d72d /src | |
parent | ddc8c820a3234bc60d61da1db8da502806dca592 (diff) | |
download | skyblock-api-ed72217fd73eca1de929f915056e13be9d4085f9.tar.gz skyblock-api-ed72217fd73eca1de929f915056e13be9d4085f9.tar.bz2 skyblock-api-ed72217fd73eca1de929f915056e13be9d4085f9.zip |
fix bug: the prequel
Diffstat (limited to 'src')
-rw-r--r-- | src/hypixel.ts | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/hypixel.ts b/src/hypixel.ts index fbb01f0..d4e1a49 100644 --- a/src/hypixel.ts +++ b/src/hypixel.ts @@ -384,7 +384,7 @@ export async function periodicallyFetchRecentlyEndedAuctions() { const itemsAuctions = await fetchItemsAuctions(Array.from(newAuctionItemIds)) for (const itemAuctions of itemsAuctions) { - updatedDatabaseAuctionItems[itemAuctions._id] = itemAuctions + updatedDatabaseAuctionItems.set(itemAuctions._id, itemAuctions) } for (const auction of endedAuctions.auctions) { @@ -392,10 +392,6 @@ export async function periodicallyFetchRecentlyEndedAuctions() { let auctions: SimpleAuctionSchema[] if (!updatedDatabaseAuctionItems.has(auction.item.id)) { - updatedDatabaseAuctionItems.set(auction.item.id, { - _id: auction.item.id, - auctions: [], - }) auctions = [] } else { auctions = updatedDatabaseAuctionItems.get(auction.item.id)!.auctions @@ -413,7 +409,7 @@ export async function periodicallyFetchRecentlyEndedAuctions() { auctions.push(simpleAuction) // keep only the last 100 items if (auctions.length > 100) - auctions = auctions.slice(auctions.length - 100) + auctions = auctions.slice(-100) } updatedDatabaseAuctionItems.set(auction.item.id, { |