From 9defd9b01b3c733c2e423f32e92c748d70765c87 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 18 May 2022 15:35:31 +0000 Subject: split pets into their own auction items --- src/database.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/database.ts') 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, -- cgit