fix: not being able to buy incarnon bundles #337

Merged
Sainan merged 2 commits from incarnon-bundles into main 2024-06-20 07:35:24 -07:00
Showing only changes of commit 97eedf8c5b - Show all commits

View File

@ -26,7 +26,7 @@ import { logger } from "@/src/utils/logger";
import { WeaponTypeInternal, getWeaponType, getExalted } from "@/src/services/itemDataService";
import { ISyndicateSacrifice, ISyndicateSacrificeResponse } from "../types/syndicateTypes";
import { IEquipmentClient } from "../types/inventoryTypes/commonInventoryTypes";
import { ExportRecipes } from "warframe-public-export-plus";
import { ExportRecipes, ExportResources } from "warframe-public-export-plus";
export const createInventory = async (
accountOwnerId: Types.ObjectId,
@ -88,6 +88,22 @@ export const addItem = async (
}
};
}
if (typeName in ExportResources) {
const inventory = await getInventory(accountId);
const miscItemChanges = [
{
ItemType: typeName,
ItemCount: quantity
} satisfies IMiscItem
];
addMiscItems(inventory, miscItemChanges);
await inventory.save();
return {
InventoryChanges: {
MiscItems: miscItemChanges
}
};
}
// Path-based duck typing
switch (typeName.substr(1).split("/")[1]) {