done
This commit is contained in:
parent
6997e13d28
commit
a6bdd87088
@ -57,7 +57,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.104",
|
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.105",
|
||||||
"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",
|
||||||
|
@ -56,7 +56,7 @@ export default class CustomersController extends ApiController {
|
|||||||
/**
|
/**
|
||||||
* @description Create a new customer
|
* @description Create a new customer
|
||||||
*/
|
*/
|
||||||
@Post("/api/v1/notary/customers", [authHandler, ruleHandler])
|
@Post("/api/v1/admin/customers", [authHandler, ruleHandler])
|
||||||
protected async post(req: Request, response: Response) {
|
protected async post(req: Request, response: Response) {
|
||||||
try {
|
try {
|
||||||
//init IUser resource with request body values
|
//init IUser resource with request body values
|
||||||
@ -69,6 +69,8 @@ export default class CustomersController extends ApiController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!customerEntity.contact?.cell_phone_number) return;
|
||||||
|
|
||||||
const customers = await this.customersService.get({
|
const customers = await this.customersService.get({
|
||||||
where: {
|
where: {
|
||||||
contact: { email: customerEntity.contact?.email },
|
contact: { email: customerEntity.contact?.email },
|
||||||
|
@ -68,6 +68,8 @@ export default class CustomersController extends ApiController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!customerEntity.contact?.cell_phone_number) return;
|
||||||
|
|
||||||
const customers = await this.customersService.get({
|
const customers = await this.customersService.get({
|
||||||
where: {
|
where: {
|
||||||
contact: { email: customerEntity.contact?.email },
|
contact: { email: customerEntity.contact?.email },
|
||||||
|
@ -57,7 +57,7 @@ export default class CustomersController extends ApiController {
|
|||||||
/**
|
/**
|
||||||
* @description Create a new customer
|
* @description Create a new customer
|
||||||
*/
|
*/
|
||||||
@Post("/api/v1/notary/customers", [authHandler, ruleHandler])
|
@Post("/api/v1/super-admin/customers", [authHandler, ruleHandler])
|
||||||
protected async post(req: Request, response: Response) {
|
protected async post(req: Request, response: Response) {
|
||||||
try {
|
try {
|
||||||
//init IUser resource with request body values
|
//init IUser resource with request body values
|
||||||
@ -70,6 +70,8 @@ export default class CustomersController extends ApiController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!customerEntity.contact?.cell_phone_number) return;
|
||||||
|
|
||||||
const customers = await this.customersService.get({
|
const customers = await this.customersService.get({
|
||||||
where: {
|
where: {
|
||||||
contact: { email: customerEntity.contact?.email },
|
contact: { email: customerEntity.contact?.email },
|
||||||
|
@ -13,7 +13,7 @@ export default function authHandler(req: Request, response: Response, next: Next
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const authService = Container.get(AuthService);
|
const authService = Container.get(AuthService);
|
||||||
authService.verifyAccessToken(token, (err, userPayload) => {
|
authService.verifyAccessToken(token, (err, userPayload) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
response.status(HttpCodes.UNAUTHORIZED).send("Error while verifying token");
|
response.status(HttpCodes.UNAUTHORIZED).send("Error while verifying token");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user