Merge branch 'dev' into staging

This commit is contained in:
Vins 2024-04-23 18:03:03 +02:00
commit 02c4f92165

View File

@ -130,7 +130,11 @@ export default class UserController extends ApiController {
if(!isSubscribed && userHydrated.role?.name === "admin" || userHydrated.role?.name === "super-admin"){
const manageSubscriptionRulesEntity = await this.rulesGroupsService.get({ where: { name: "Gestion de l'abonnement" }, include: { rules: true } });
console.log("manageSubscriptionRulesEntity", manageSubscriptionRulesEntity);
const manageSubscriptionRules = RulesGroup.hydrateArray<RulesGroup>(manageSubscriptionRulesEntity, { strategy: "excludeAll" });
console.log("manageSubscriptionRules", manageSubscriptionRules);
if(!manageSubscriptionRules[0]) return;
payload.rules = manageSubscriptionRules[0].rules!.map((rule) => rule.name) || [];