feat: handle mechsuits in sellController (#1996)
Closes #1995 Reviewed-on: #1996 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
parent
4f28688837
commit
4b12fe12cb
@ -45,6 +45,9 @@ export const sellController: RequestHandler = async (req, res) => {
|
||||
if (payload.Items.SpaceGuns || payload.Items.SpaceMelee) {
|
||||
requiredFields.add(InventorySlot.SPACEWEAPONS);
|
||||
}
|
||||
if (payload.Items.MechSuits) {
|
||||
requiredFields.add(InventorySlot.MECHSUITS);
|
||||
}
|
||||
if (payload.Items.Sentinels || payload.Items.SentinelWeapons || payload.Items.MoaPets) {
|
||||
requiredFields.add(InventorySlot.SENTINELS);
|
||||
}
|
||||
@ -136,6 +139,12 @@ export const sellController: RequestHandler = async (req, res) => {
|
||||
freeUpSlot(inventory, InventorySlot.SPACEWEAPONS);
|
||||
});
|
||||
}
|
||||
if (payload.Items.MechSuits) {
|
||||
payload.Items.MechSuits.forEach(sellItem => {
|
||||
inventory.MechSuits.pull({ _id: sellItem.String });
|
||||
freeUpSlot(inventory, InventorySlot.MECHSUITS);
|
||||
});
|
||||
}
|
||||
if (payload.Items.Sentinels) {
|
||||
payload.Items.Sentinels.forEach(sellItem => {
|
||||
inventory.Sentinels.pull({ _id: sellItem.String });
|
||||
@ -285,6 +294,7 @@ interface ISellRequest {
|
||||
SpaceSuits?: ISellItem[];
|
||||
SpaceGuns?: ISellItem[];
|
||||
SpaceMelee?: ISellItem[];
|
||||
MechSuits?: ISellItem[];
|
||||
Sentinels?: ISellItem[];
|
||||
SentinelWeapons?: ISellItem[];
|
||||
MoaPets?: ISellItem[];
|
||||
|
Loading…
x
Reference in New Issue
Block a user