feat(server): rename contributionTier → contributionAmount in routes + utils
This commit is contained in:
parent
7a2acd4628
commit
57f5152be4
18 changed files with 35 additions and 35 deletions
|
|
@ -7,12 +7,12 @@ export default defineEventHandler(async (event) => {
|
|||
const member = await requireAuth(event);
|
||||
|
||||
// If already on free tier, nothing to cancel
|
||||
if (member.contributionTier === "0" || !member.helcimSubscriptionId) {
|
||||
if (member.contributionAmount === 0 || !member.helcimSubscriptionId) {
|
||||
return {
|
||||
success: true,
|
||||
message: "No active subscription to cancel",
|
||||
status: member.status,
|
||||
contributionTier: member.contributionTier,
|
||||
contributionAmount: member.contributionAmount,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -29,7 +29,7 @@ export default defineEventHandler(async (event) => {
|
|||
{
|
||||
$set: {
|
||||
status: 'pending_payment',
|
||||
contributionTier: '0',
|
||||
contributionAmount: 0,
|
||||
helcimSubscriptionId: null,
|
||||
paymentMethod: 'none',
|
||||
subscriptionEndDate: new Date(),
|
||||
|
|
@ -46,7 +46,7 @@ export default defineEventHandler(async (event) => {
|
|||
success: true,
|
||||
message: "Subscription cancelled successfully",
|
||||
status: 'pending_payment',
|
||||
contributionTier: '0',
|
||||
contributionAmount: 0,
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("Error cancelling subscription:", error);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue