change user to uuid
This commit is contained in:
parent
07f8e2dbcb
commit
f89483f878
46 changed files with 146 additions and 151 deletions
|
@ -16,7 +16,7 @@ import ForbiddenRequestException from "../exceptions/forbiddenRequestException";
|
|||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function getMeById(req: Request, res: Response): Promise<any> {
|
||||
const id = parseInt(req.userId);
|
||||
const id = req.userId;
|
||||
let user = await UserService.getById(id);
|
||||
|
||||
res.json(UserFactory.mapToSingle(user));
|
||||
|
@ -29,7 +29,7 @@ export async function getMeById(req: Request, res: Response): Promise<any> {
|
|||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function getMyTotp(req: Request, res: Response): Promise<any> {
|
||||
const userId = parseInt(req.userId);
|
||||
const userId = req.userId;
|
||||
|
||||
let { secret } = await UserService.getById(userId);
|
||||
|
||||
|
@ -54,7 +54,7 @@ export async function getMyTotp(req: Request, res: Response): Promise<any> {
|
|||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function verifyMyTotp(req: Request, res: Response): Promise<any> {
|
||||
const userId = parseInt(req.userId);
|
||||
const userId = req.userId;
|
||||
let totp = req.body.totp;
|
||||
|
||||
let { secret } = await UserService.getById(userId);
|
||||
|
@ -78,7 +78,7 @@ export async function verifyMyTotp(req: Request, res: Response): Promise<any> {
|
|||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function transferOwnership(req: Request, res: Response): Promise<any> {
|
||||
const userId = parseInt(req.userId);
|
||||
const userId = req.userId;
|
||||
let toId = req.body.toId;
|
||||
|
||||
let { isOwner } = await UserService.getById(userId);
|
||||
|
@ -102,7 +102,7 @@ export async function transferOwnership(req: Request, res: Response): Promise<an
|
|||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function updateMe(req: Request, res: Response): Promise<any> {
|
||||
const id = parseInt(req.userId);
|
||||
const id = req.userId;
|
||||
let mail = req.body.mail;
|
||||
let firstname = req.body.firstname;
|
||||
let lastname = req.body.lastname;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue