Compare commits

..

3 Commits

Author SHA1 Message Date
Sosthene
000ed8b4b6 Merge branch 'staging' into preprod
All checks were successful
Preprod - Build & Deploy to Scaleway / build-and-push-images-lecoffre (push) Successful in 17s
Preprod - Build & Deploy to Scaleway / deploy-back-lecoffre (push) Successful in 3s
Preprod - Build & Deploy to Scaleway / deploy-cron-lecoffre (push) Successful in 3s
2025-08-03 22:17:38 +02:00
Sosthene
f4645fc14a Merge branch 'legacy_dev' into staging
All checks were successful
Staging - Build & Deploy to Scaleway / build-and-push-images-lecoffre (push) Successful in 23s
Staging - Build & Deploy to Scaleway / deploy-back-lecoffre (push) Successful in 3s
Staging - Build & Deploy to Scaleway / deploy-cron-lecoffre (push) Successful in 3s
2025-08-03 22:16:42 +02:00
Sosthene
7f52b2c5af [fix] Don't overwrite existing rules if admin is not subscribed
All checks were successful
Test - Build & Deploy to Scaleway / build-and-push-images-lecoffre (push) Successful in 1m55s
Test - Build & Deploy to Scaleway / deploy-back-lecoffre (push) Successful in 4s
Test - Build & Deploy to Scaleway / deploy-cron-lecoffre (push) Successful in 3s
2025-08-03 22:14:27 +02:00

View File

@ -112,7 +112,9 @@ export default class UserController extends ApiController {
});
if (!manageSubscriptionRules[0]) return;
payload.rules = manageSubscriptionRules[0].rules!.map((rule) => rule.name) || [];
// Merge subscription rules with existing rules instead of replacing them
const subscriptionRules = manageSubscriptionRules[0].rules!.map((rule) => rule.name) || [];
payload.rules = [...new Set([...payload.rules, ...subscriptionRules])];
isSubscribed = true;
}
@ -173,7 +175,9 @@ export default class UserController extends ApiController {
});
if (!manageSubscriptionRules[0]) return;
newUserPayload.rules = manageSubscriptionRules[0].rules!.map((rule) => rule.name) || [];
// Merge subscription rules with existing rules instead of replacing them
const subscriptionRules = manageSubscriptionRules[0].rules!.map((rule) => rule.name) || [];
newUserPayload.rules = [...new Set([...newUserPayload.rules, ...subscriptionRules])];
isSubscribed = true;
}