fix package version

This commit is contained in:
OxSaitama 2023-10-13 11:26:29 +02:00
parent 5643a8ffe7
commit 988a10efde
2 changed files with 19 additions and 11 deletions

View File

@ -53,7 +53,7 @@
"express": "^4.18.2",
"fp-ts": "^2.16.1",
"jsonwebtoken": "^9.0.0",
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.92",
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.93",
"module-alias": "^2.2.2",
"monocle-ts": "^2.3.13",
"multer": "^1.4.5-lts.1",

View File

@ -34,26 +34,34 @@ export default class CustomerController extends ApiController {
return;
}
try {
await new Promise( resolve => setTimeout(resolve, 3000)); // wait 3 seconds to be sure that the enrollment is finilazed
await new Promise((resolve) => setTimeout(resolve, 3000)); // wait 3 seconds to be sure that the enrollment is finilazed
const res = await this.id360Service.getEnrollment(callbackToken);
const enrollment = await res.json() as EnrollmentResponse;
const enrollment = (await res.json()) as EnrollmentResponse;
if (enrollment.status !== "OK") {
this.httpUnauthorized(response, "Enrollment status is not OK");
return;
}
const customerData = await this.id360Service.getReport(enrollment.id);
const customer = await this.customerService.get({
where: {
contact: {
last_name: { contains: customerData.external_methods.france_connect.results.france_connect_out_userinfo[0].family_name,
mode: 'insensitive' },
first_name: { contains: customerData.external_methods.france_connect.results.france_connect_out_userinfo[0].given_name.split(" ")[0],
mode: 'insensitive'},
last_name: {
contains: customerData.external_methods.france_connect.results.france_connect_out_userinfo[0].family_name,
mode: "insensitive",
},
first_name: {
contains:
customerData.external_methods.france_connect.results.france_connect_out_userinfo[0].given_name.split(
" ",
)[0],
mode: "insensitive",
},
},
},
include: {
contact: true,
}
},
});
// const contact = await this.customerService.getByEmail(
// customerData.external_methods.france_connect.results.france_connect_out_userinfo[0].email,