Tests, UX improvements.
This commit is contained in:
parent
4e6f5d36b8
commit
0ae18f495e
63 changed files with 1384 additions and 2330 deletions
|
|
@ -26,6 +26,11 @@ export default defineEventHandler(async (event) => {
|
|||
};
|
||||
}
|
||||
|
||||
// Log contribution change (fire-and-forget, at the top so it logs regardless of which case path executes)
|
||||
const logContributionChange = () => {
|
||||
logActivity(member._id, 'contribution_changed', { from: oldTier, to: newTier })
|
||||
}
|
||||
|
||||
const helcimToken = config.helcimApiToken;
|
||||
const oldRequiresPayment = requiresPayment(oldTier);
|
||||
const newRequiresPayment = requiresPayment(newTier);
|
||||
|
|
@ -160,6 +165,8 @@ export default defineEventHandler(async (event) => {
|
|||
{ runValidators: false }
|
||||
);
|
||||
|
||||
logContributionChange()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
message: "Successfully upgraded to paid tier",
|
||||
|
|
@ -216,6 +223,8 @@ export default defineEventHandler(async (event) => {
|
|||
{ runValidators: false }
|
||||
);
|
||||
|
||||
logContributionChange()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
message: "Successfully downgraded to free tier",
|
||||
|
|
@ -279,6 +288,8 @@ export default defineEventHandler(async (event) => {
|
|||
{ runValidators: false }
|
||||
);
|
||||
|
||||
logContributionChange()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
message: "Successfully updated contribution level",
|
||||
|
|
@ -300,6 +311,8 @@ export default defineEventHandler(async (event) => {
|
|||
{ runValidators: false }
|
||||
);
|
||||
|
||||
logContributionChange()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
message: "Successfully updated contribution level",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue