Commit cd4ef015 authored by Pavel Mishakov's avatar Pavel Mishakov

user controller fix

parent aabf6f85
...@@ -3,6 +3,7 @@ import express, {Request, Response, Router} from 'express' ...@@ -3,6 +3,7 @@ import express, {Request, Response, Router} from 'express'
import IResponse from "../interfaces/IResponse" import IResponse from "../interfaces/IResponse"
import IUser from "../interfaces/IUser" import IUser from "../interfaces/IUser"
import { User } from "../models/mongo/User" import { User } from "../models/mongo/User"
import { EStatuses } from "../enums/EStatuses"
...@@ -53,13 +54,13 @@ export class UserController { ...@@ -53,13 +54,13 @@ export class UserController {
console.log(user) console.log(user)
if(!user) { if(!user) {
res.status(200).send({ res.status(200).send({
isStatusOk: false, status: EStatuses.OK,
result: undefined, result: undefined,
message: 'Not authorized' message: 'Not authorized'
}) })
} else { } else {
const response: IResponse<IUser | undefined> = { const response: IResponse<IUser | undefined> = {
isStatusOK: true, status: EStatuses.NOT_OK,
result: user, result: user,
message: 'Token is ok' message: 'Token is ok'
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment