fix: selling MiscItems doesn't remove them from inventory
This commit is contained in:
parent
48aa145a20
commit
fe04a20e26
@ -86,6 +86,16 @@ export const sellController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (payload.Items.MiscItems) {
|
||||||
|
payload.Items.MiscItems.forEach(sellItem => {
|
||||||
|
addMiscItems(inventory, [
|
||||||
|
{
|
||||||
|
ItemType: sellItem.String,
|
||||||
|
ItemCount: sellItem.Count * -1
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.json({});
|
res.json({});
|
||||||
|
@ -7,6 +7,7 @@ export interface ISellRequest {
|
|||||||
Consumables?: ISellItem[];
|
Consumables?: ISellItem[];
|
||||||
Recipes?: ISellItem[];
|
Recipes?: ISellItem[];
|
||||||
Upgrades?: ISellItem[];
|
Upgrades?: ISellItem[];
|
||||||
|
MiscItems?: ISellItem[];
|
||||||
};
|
};
|
||||||
SellPrice: number;
|
SellPrice: number;
|
||||||
SellCurrency:
|
SellCurrency:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user