Removed subscription requirements for dev enf
This commit is contained in:
parent
83c095f153
commit
86cccab8da
@ -11,11 +11,12 @@ import UsersService from "@Services/super-admin/UsersService/UsersService";
|
||||
import SubscriptionsService from "@Services/admin/SubscriptionsService/SubscriptionsService.ts";
|
||||
import { ESubscriptionStatus } from "@prisma/client";
|
||||
import SeatsService from "@Services/admin/SeatsService/SeatsService";
|
||||
import { BackendVariables } from "@Common/config/variables/Variables";
|
||||
|
||||
@Controller()
|
||||
@Service()
|
||||
export default class UserController extends ApiController {
|
||||
constructor(private authService: AuthService, private idNotService: IdNotService, private whitelistService: WhitelistService, private userService: UsersService, private subscriptionsService: SubscriptionsService, private seatsService: SeatsService) {
|
||||
constructor(private authService: AuthService, private idNotService: IdNotService, private whitelistService: WhitelistService, private userService: UsersService, private subscriptionsService: SubscriptionsService, private seatsService: SeatsService, private backendVariables: BackendVariables) {
|
||||
super();
|
||||
}
|
||||
|
||||
@ -68,12 +69,12 @@ export default class UserController extends ApiController {
|
||||
const subscriptions = await this.subscriptionsService.get({ where: { office_uid: userHydrated.office_membership?.uid } });
|
||||
|
||||
if(!subscriptions || subscriptions.length === 0) {
|
||||
this.httpUnauthorized(response, "No subscription found");
|
||||
isSubscribed = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if(subscriptions[0]?.status === ESubscriptionStatus.INACTIVE) {
|
||||
this.httpUnauthorized(response, "Subscription inactive");
|
||||
isSubscribed = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -95,12 +96,12 @@ export default class UserController extends ApiController {
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.httpUnauthorized(response, "No seat available");
|
||||
isSubscribed = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(!isSubscribed) {
|
||||
if(this.backendVariables.ENV !== 'dev' && !isSubscribed) {
|
||||
this.httpUnauthorized(response, "User not subscribed");
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user