logs
This commit is contained in:
parent
6fd0cb67da
commit
32f92787cc
@ -47,6 +47,8 @@ export default class UserController extends ApiController {
|
||||
}
|
||||
|
||||
const user = await this.idNotService.getOrCreateUser(idNotToken);
|
||||
console.log(user);
|
||||
|
||||
|
||||
if (!user) {
|
||||
this.httpUnauthorized(response, "User not found");
|
||||
@ -58,6 +60,8 @@ export default class UserController extends ApiController {
|
||||
//Whitelist feature
|
||||
//Get user with contact
|
||||
const prismaUser = await this.userService.getByUid(user.uid, { contact: true, role: true });
|
||||
console.log(prismaUser);
|
||||
|
||||
|
||||
if (!prismaUser) {
|
||||
this.httpNotFoundRequest(response, "user not found");
|
||||
@ -66,6 +70,8 @@ export default class UserController extends ApiController {
|
||||
|
||||
//Hydrate user to be able to use his contact
|
||||
const userHydrated = User.hydrate<User>(prismaUser, { strategy: "excludeAll" });
|
||||
console.log(userHydrated);
|
||||
|
||||
|
||||
if (!userHydrated.contact?.email || userHydrated.contact?.email === "") {
|
||||
this.httpUnauthorized(response, "Email not found");
|
||||
@ -76,7 +82,6 @@ export default class UserController extends ApiController {
|
||||
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) {
|
||||
console.log("no subscription");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user