Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
I
initial_project
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Нұрасыл Қайратұлы
initial_project
Commits
a2e84f82
Commit
a2e84f82
authored
Aug 09, 2024
by
Нұрасыл Қайратұлы
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
7a06930d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
user.controller.ts
server/src/controllers/user.controller.ts
+9
-9
No files found.
server/src/controllers/user.controller.ts
View file @
a2e84f82
...
...
@@ -3,6 +3,7 @@ import { RequestHandler } from "express";
import
{
plainToInstance
}
from
'class-transformer'
;
// import { SignInUserDto } from "@/dto/sign-in-user.dto";
import
{
RegistrationUserDto
}
from
"@/dto/registration-user.dto"
;
import
{
SignInUserDto
}
from
"@/dto/sign-in-user.dto"
;
export
class
UserController
{
private
service
:
UserService
;
...
...
@@ -12,14 +13,13 @@ export class UserController {
}
signIn
:
RequestHandler
=
async
(
req
,
res
):
Promise
<
void
>
=>
{
res
.
send
(
req
.
headers
.
authorization
)
// try {
// const signInDto = plainToInstance(SignInUserDto, req.body)
// const user = await this.service.signIn(signInDto)
// res.send(user)
// } catch (e) {
// res.status(401).send((e as Error).message)
// }
try
{
const
signInDto
=
plainToInstance
(
SignInUserDto
,
req
.
body
)
const
user
=
await
this
.
service
.
signIn
(
signInDto
)
res
.
send
(
user
)
}
catch
(
e
)
{
res
.
status
(
401
).
send
((
e
as
Error
).
message
)
}
}
registration
:
RequestHandler
=
async
(
req
,
res
):
Promise
<
void
>
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment