aboutsummaryrefslogtreecommitdiff
path: root/src/database.ts
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-05-18 15:35:31 +0000
committermat <github@matdoes.dev>2022-05-18 15:35:31 +0000
commit9defd9b01b3c733c2e423f32e92c748d70765c87 (patch)
tree90df15f0e7423501d42ed2400251404e856fbea6 /src/database.ts
parent21be335df3ad9f9f9008cd7138866234c922ca7d (diff)
downloadskyblock-api-9defd9b01b3c733c2e423f32e92c748d70765c87.tar.gz
skyblock-api-9defd9b01b3c733c2e423f32e92c748d70765c87.tar.bz2
skyblock-api-9defd9b01b3c733c2e423f32e92c748d70765c87.zip
split pets into their own auction items
Diffstat (limited to 'src/database.ts')
-rw-r--r--src/database.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/database.ts b/src/database.ts
index d0ad04b..e31794a 100644
--- a/src/database.ts
+++ b/src/database.ts
@@ -146,11 +146,13 @@ export interface SimpleAuctionSchema {
export interface ItemAuctionsSchema {
/** The id of the item */
id: string
+ sbId: string
auctions: SimpleAuctionSchema[]
}
export interface ItemAuctionsSchemaBson {
/** The id of the item */
_id: string
+ sbId: string
auctions: SimpleAuctionSchemaBson[]
/** This is here so it can be indexed by Mongo, it can easily be figured out by getting the first item in auctions */
oldestDate: number
@@ -1116,6 +1118,7 @@ export async function updateAccount(discordId: string, schema: AccountSchema) {
function toItemAuctionsSchema(i: ItemAuctionsSchemaBson): ItemAuctionsSchema {
return {
id: i._id,
+ sbId: i.sbId,
auctions: i.auctions.map(a => {
return {
...a,
@@ -1128,6 +1131,7 @@ function toItemAuctionsSchema(i: ItemAuctionsSchemaBson): ItemAuctionsSchema {
function toItemAuctionsSchemaBson(i: ItemAuctionsSchema): ItemAuctionsSchemaBson {
return {
_id: i.id,
+ sbId: i.sbId,
auctions: i.auctions.map(a => {
return {
...a,