Preprod (#177)
This commit is contained in:
commit
9c6eac97fe
@ -58,7 +58,7 @@
|
|||||||
"file-type-checker": "^1.0.8",
|
"file-type-checker": "^1.0.8",
|
||||||
"fp-ts": "^2.16.1",
|
"fp-ts": "^2.16.1",
|
||||||
"jsonwebtoken": "^9.0.0",
|
"jsonwebtoken": "^9.0.0",
|
||||||
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.106",
|
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.108",
|
||||||
"module-alias": "^2.2.2",
|
"module-alias": "^2.2.2",
|
||||||
"monocle-ts": "^2.3.13",
|
"monocle-ts": "^2.3.13",
|
||||||
"multer": "^1.4.5-lts.1",
|
"multer": "^1.4.5-lts.1",
|
||||||
|
@ -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,10 +47,15 @@ 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 === "") {
|
||||||
|
this.httpUnauthorized(response, "Email not found");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//Check if user is whitelisted
|
//Check if user is whitelisted
|
||||||
const isWhitelisted = await this.whitelistService.getByEmail(userHydrated.contact!.email);
|
const isWhitelisted = await this.whitelistService.getByEmail(userHydrated.contact!.email);
|
||||||
|
@ -168,7 +168,7 @@ export default class OfficeFoldersController extends ApiController {
|
|||||||
|
|
||||||
const officeFolderFound = await this.officeFoldersService.getByUid(uid, {
|
const officeFolderFound = await this.officeFoldersService.getByUid(uid, {
|
||||||
folder_anchor: true,
|
folder_anchor: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!officeFolderFound) {
|
if (!officeFolderFound) {
|
||||||
this.httpNotFoundRequest(response, "office folder not found");
|
this.httpNotFoundRequest(response, "office folder not found");
|
||||||
@ -184,11 +184,6 @@ export default class OfficeFoldersController extends ApiController {
|
|||||||
//validate folder
|
//validate folder
|
||||||
await validateOrReject(officefolderToUpdate, { groups: ["updateFolder"], forbidUnknownValues: false });
|
await validateOrReject(officefolderToUpdate, { groups: ["updateFolder"], forbidUnknownValues: false });
|
||||||
|
|
||||||
if ((officeFolderFound as any).folder_anchor?.status !== "VERIFIED_ON_CHAIN") {
|
|
||||||
this.httpBadRequest(response, "Cannot archive a not anchored folder");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//call service to get prisma entity
|
//call service to get prisma entity
|
||||||
const officeFolderEntityUpdated = await this.officeFoldersService.updateStatus(uid, officefolderToUpdate);
|
const officeFolderEntityUpdated = await this.officeFoldersService.updateStatus(uid, officefolderToUpdate);
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@ export default class DocumentTypesRepository extends BaseRepository {
|
|||||||
* @description : Find many document types
|
* @description : Find many document types
|
||||||
*/
|
*/
|
||||||
public async findMany(query: Prisma.DocumentTypesFindManyArgs) {
|
public async findMany(query: Prisma.DocumentTypesFindManyArgs) {
|
||||||
query.take = Math.min(query.take || this.defaultFetchRows, this.maxFetchRows);
|
|
||||||
return this.model.findMany(query);
|
return this.model.findMany(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +120,9 @@ export default class IdNotService extends BaseService {
|
|||||||
redirect_uri: this.variables.IDNOT_REDIRECT_URL,
|
redirect_uri: this.variables.IDNOT_REDIRECT_URL,
|
||||||
code: code,
|
code: code,
|
||||||
grant_type: "authorization_code",
|
grant_type: "authorization_code",
|
||||||
});
|
});
|
||||||
|
console.log(this.variables.IDNOT_BASE_URL + this.variables.IDNOT_CONNEXION_URL + "?" + query.toString());
|
||||||
|
|
||||||
const token = await fetch(this.variables.IDNOT_BASE_URL + this.variables.IDNOT_CONNEXION_URL + "?" + query, { method: "POST" });
|
const token = await fetch(this.variables.IDNOT_BASE_URL + this.variables.IDNOT_CONNEXION_URL + "?" + query, { method: "POST" });
|
||||||
if(token.status !== 200) console.error(await token.text());
|
if(token.status !== 200) console.error(await token.text());
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user