Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
planner-team-one
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
21
Issues
21
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
Евгений Положенцев
planner-team-one
Commits
a6b7e8fc
Commit
a6b7e8fc
authored
Nov 13, 2022
by
“Yevgeniy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix of types in back
parent
91e2ce16
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
users.ts
planner-api/src/routers/users.ts
+8
-4
No files found.
planner-api/src/routers/users.ts
View file @
a6b7e8fc
...
...
@@ -2,18 +2,22 @@ import express,{Router, Request, Response} from 'express';
import
{
User
}
from
'../models/User'
;
import
{
myDataSource
}
from
'../app-data-source'
;
import
{
nanoid
}
from
'nanoid'
;
import
multer
=
require
(
'multer'
)
;
import
path
=
require
(
"path"
)
;
import
multer
from
'multer'
;
import
path
from
'path'
;
import
{
config
}
from
"../config"
const
router
:
Router
=
express
.
Router
();
const
dataSource
=
myDataSource
;
type
DestinationCallback
=
(
error
:
Error
|
null
,
destination
:
string
)
=>
void
type
FileNameCallback
=
(
error
:
Error
|
null
,
filename
:
string
)
=>
void
const
storage
=
multer
.
diskStorage
({
destination
:
(
req
,
file
,
cb
)
=>
{
destination
:
(
req
:
Request
,
file
:
Express
.
Multer
.
File
,
cb
:
DestinationCallback
)
=>
{
cb
(
null
,
config
.
uploadPath
);
},
filename
:
(
req
,
file
,
cb
)
=>
{
filename
:
(
req
:
Request
,
file
:
Express
.
Multer
.
File
,
cb
:
FileNameCallback
)
=>
{
cb
(
null
,
nanoid
()
+
path
.
extname
(
file
.
originalname
));
}
})
...
...
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