update profile and password

This commit is contained in:
2024-11-27 17:20:17 +07:00
parent 98b6bf4cd6
commit 7b712d9ee9
3 changed files with 7 additions and 17 deletions

View File

@ -1,4 +1,5 @@
import { Request, Response, NextFunction, Application } from "express";
import { Response, NextFunction, Application } from "express";
import { Request } from "express-jwt";
import { ReturnHelper } from "../helpers/express/return";
import { OrmHelper } from "../helpers/orm";
import { User } from "../entity/users";
@ -161,12 +162,6 @@ export class UserController {
#swagger.security = [{
"bearerAuth": []
}]
#swagger.parameters['id'] = {
in: 'path',
description: 'User ID.',
required: true,
type: 'string'
}
#swagger.requestBody = {
required: true,
@ -188,7 +183,7 @@ export class UserController {
name: Joi.string().max(64).required().label('Name'),
});
req.body.id = req.params['id'];
req.body.id = req.auth.data.id;
const param: User = await schema.validateAsync(req.body);
@ -221,12 +216,6 @@ export class UserController {
#swagger.security = [{
"bearerAuth": []
}]
#swagger.parameters['id'] = {
in: 'path',
description: 'User ID.',
required: true,
type: 'string'
}
#swagger.requestBody = {
required: true,
@ -247,7 +236,7 @@ export class UserController {
retype_password: Joi.ref('password'),
});
req.body.id = req.params['id'];
req.body.id = req.auth.data.id;
const param: User = await schema.validateAsync(req.body);