Fix login
This commit is contained in:
parent
1abab5dad2
commit
ed46eddf29
@ -127,7 +127,17 @@ export default class UserController extends ApiController {
|
|||||||
if(!payload) return;
|
if(!payload) return;
|
||||||
|
|
||||||
console.log(isSubscribed, userHydrated.role?.name);
|
console.log(isSubscribed, userHydrated.role?.name);
|
||||||
if(!isSubscribed && userHydrated.role?.name === "admin" || userHydrated.role?.name === "super-admin"){
|
if(!isSubscribed && userHydrated.role?.name === "admin"){
|
||||||
|
const manageSubscriptionRulesEntity = await this.rulesGroupsService.get({ where: { uid: "94343601-04c8-44ef-afb9-3047597528a9" }, include: { rules: true } });
|
||||||
|
|
||||||
|
const manageSubscriptionRules = RulesGroup.hydrateArray<RulesGroup>(manageSubscriptionRulesEntity, { strategy: "excludeAll" });
|
||||||
|
if(!manageSubscriptionRules[0]) return;
|
||||||
|
|
||||||
|
payload.rules = manageSubscriptionRules[0].rules!.map((rule) => rule.name) || [];
|
||||||
|
|
||||||
|
isSubscribed = true;
|
||||||
|
}
|
||||||
|
if(!isSubscribed && userHydrated.role?.name === "super-admin"){
|
||||||
const manageSubscriptionRulesEntity = await this.rulesGroupsService.get({ where: { uid: "94343601-04c8-44ef-afb9-3047597528a9" }, include: { rules: true } });
|
const manageSubscriptionRulesEntity = await this.rulesGroupsService.get({ where: { uid: "94343601-04c8-44ef-afb9-3047597528a9" }, include: { rules: true } });
|
||||||
|
|
||||||
const manageSubscriptionRules = RulesGroup.hydrateArray<RulesGroup>(manageSubscriptionRulesEntity, { strategy: "excludeAll" });
|
const manageSubscriptionRules = RulesGroup.hydrateArray<RulesGroup>(manageSubscriptionRulesEntity, { strategy: "excludeAll" });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user