Fixed email empty
This commit is contained in:
parent
c6335996a6
commit
2810a37bd4
@ -34,7 +34,7 @@ export default class UserController extends ApiController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const user = await this.idNotService.getOrCreateUser(idNotToken);
|
const user = await this.idNotService.getOrCreateUser(idNotToken);
|
||||||
|
|
||||||
if(!user) {
|
if(!user) {
|
||||||
this.httpUnauthorized(response, "Email not found");
|
this.httpUnauthorized(response, "Email not found");
|
||||||
@ -47,13 +47,13 @@ export default class UserController extends ApiController {
|
|||||||
if (!prismaUser) {
|
if (!prismaUser) {
|
||||||
this.httpNotFoundRequest(response, "user not found");
|
this.httpNotFoundRequest(response, "user not found");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Hydrate user to be able to use his contact
|
//Hydrate user to be able to use his contact
|
||||||
const userHydrated = User.hydrate<User>(prismaUser, { strategy: "excludeAll" });
|
const userHydrated = User.hydrate<User>(prismaUser, { strategy: "excludeAll" });
|
||||||
|
|
||||||
if(!userHydrated.contact?.email || userHydrated.contact?.email === "") {
|
if(!userHydrated.contact?.email || userHydrated.contact?.email === "") {
|
||||||
this.httpBadRequest(response, "Email not found");
|
this.httpUnauthorized(response, "Email not found");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user