feat: implement CreditBundle purchases #989

Merged
OrdisPrime merged 5 commits from neon/SpaceNinjaServer:credit-bundles into main 2025-02-23 03:53:57 -08:00
Showing only changes of commit 998808505d - Show all commits

View File

@ -335,10 +335,9 @@ const handleCreditBundlePurchase = async (
typeName: string, typeName: string,
inventory: TInventoryDatabaseDocument inventory: TInventoryDatabaseDocument
): Promise<IPurchaseResponse> => { ): Promise<IPurchaseResponse> => {
const bundleName = typeName.split("/").pop(); if (typeName && typeName in creditBundles) {
const creditsAmount = creditBundles[typeName];
if (bundleName && bundleName in creditBundles) {
const creditsAmount = creditBundles[bundleName];
inventory.RegularCredits += creditsAmount; inventory.RegularCredits += creditsAmount;
await inventory.save(); await inventory.save();