diff --git a/server/patreon.mjs b/server/patreon.mjs index 695da7e..0013c29 100644 --- a/server/patreon.mjs +++ b/server/patreon.mjs @@ -128,10 +128,13 @@ const getComputeAmountForTier = tierId => { let amount; switch (tierId) { + case undefined: { + amount = nonHamisAmount; + break; + } case "9702578": { // Hämis amount = hamisAmount; - break; } case "9702590": { @@ -619,8 +622,12 @@ const updatePatreonCompute = async () => { if (patron) { const tierIds = patron.relationships.currently_entitled_tiers.data.map(t => t.id); tierId = tierIds[0]; + } else { + logs.push({ message: "User not found in patron members", userId: user.id }); } + logs.push({ message: "Tier ID", tierId }); + const amount = getComputeAmountForTier(tierId); logs.push({ message: "Compute amount calculated", userId: user.id, tierId, amount });