Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
E
exam_11_back
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
zarina
exam_11_back
Commits
3c395ae3
Commit
3c395ae3
authored
Jul 30, 2020
by
zarina
🌊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
рефактор кода
parent
d2e82b69
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
5 deletions
+1
-5
products.js
app/products.js
+1
-3
users.js
app/users.js
+0
-2
No files found.
app/products.js
View file @
3c395ae3
...
...
@@ -44,7 +44,7 @@ const createRouter = () => {
if
(
req
.
file
)
{
productData
.
image
=
req
.
file
.
filename
;
}
else
{
productData
.
image
=
'
ic-dialog.pn
g'
;
productData
.
image
=
'
somePhoto.jpe
g'
;
}
const
product
=
new
Product
(
productData
);
...
...
@@ -55,7 +55,6 @@ const createRouter = () => {
}
});
router
.
delete
(
"/:id"
,
auth
,
async
(
req
,
res
)
=>
{
const
product
=
await
Product
.
findById
(
req
.
params
.
id
);
if
(
req
.
user
.
_id
.
toString
()
===
product
.
author
.
toString
())
{
...
...
@@ -66,7 +65,6 @@ const createRouter = () => {
}
});
return
router
;
};
...
...
app/users.js
View file @
3c395ae3
...
...
@@ -49,9 +49,7 @@ const createRouter = () => {
user
.
generateToken
();
await
user
.
save
();
res
.
send
(
success
);
});
return
router
;
...
...
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