Merge branch 'staging' into preprod
This commit is contained in:
commit
6eb4bd6aad
@ -73,14 +73,22 @@ export default class UserController extends ApiController {
|
|||||||
}
|
}
|
||||||
let isSubscribed = false;
|
let isSubscribed = false;
|
||||||
|
|
||||||
const subscriptions = await this.subscriptionsService.get({ where: { office_uid: userHydrated.office_membership?.uid } });
|
const subscriptions = await this.subscriptionsService.get({ where: { office_uid: userHydrated.office_membership?.uid } });
|
||||||
|
console.log(subscriptions);
|
||||||
|
|
||||||
|
|
||||||
if (!subscriptions || subscriptions.length === 0 || subscriptions[0]?.status === ESubscriptionStatus.INACTIVE) {
|
if (!subscriptions || subscriptions.length === 0 || subscriptions[0]?.status === ESubscriptionStatus.INACTIVE) {
|
||||||
|
console.log("no subscription");
|
||||||
|
|
||||||
isSubscribed = false;
|
isSubscribed = false;
|
||||||
}
|
}
|
||||||
else if (subscriptions[0]?.type === EType.Unlimited) {
|
else if (subscriptions[0]?.type === EType.Unlimited) {
|
||||||
|
console.log("unlimited subscription");
|
||||||
|
|
||||||
isSubscribed = true;
|
isSubscribed = true;
|
||||||
} else {
|
} else {
|
||||||
|
console.log("Seats");
|
||||||
|
|
||||||
const hasSeat = await this.subscriptionsService.get({
|
const hasSeat = await this.subscriptionsService.get({
|
||||||
where: { status: ESubscriptionStatus.ACTIVE, seats: { some: { user_uid: userHydrated.uid } } },
|
where: { status: ESubscriptionStatus.ACTIVE, seats: { some: { user_uid: userHydrated.uid } } },
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user