Toggle navigation
Toggle navigation
This project
Loading...
Sign in
이승윤
/
OpenSource-MyCookBook
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Song
2021-06-02 19:52:11 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e78c5041bc9657aa7abf6d2828886f3b85bd845b
e78c5041
1 parent
4697fa14
feat: video DB redirecting 수정
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
routes/categori.js
routes/categori.js
View file @
e78c504
...
...
@@ -6,7 +6,7 @@ var Youtube = require('youtube-node');
var
youtube
=
new
Youtube
();
var
loginRequired
=
require
(
'../libs/loginRequired'
);
var
redirectUrls
=
''
;
var
limit
=
10
;
// 출력 갯수
youtube
.
setKey
(
'AIzaSyCAaeW1qMSInEdN1OzU20FZlToIZYkb1bc'
);
// API 키 입력
...
...
@@ -26,7 +26,6 @@ router.get('/products', function (req, res) {
});
router
.
get
(
'/categories/write'
,
loginRequired
,
function
(
req
,
res
)
{
console
.
log
(
'??'
);
res
.
render
(
'category/form'
,
{
categories
:
''
});
});
...
...
@@ -51,6 +50,7 @@ router.post('/categories/write', loginRequired, function (req, res) {
router
.
get
(
'/products/detail/:id'
,
function
(
req
,
res
)
{
//url 에서 변수 값을 받아올때 req.params.id 로 받아온다
var
word
=
req
.
query
.
keyword
;
redirectUrls
=
req
.
params
.
id
;
CategoriModel
.
findOne
({
_id
:
req
.
params
.
id
},
function
(
err
,
product
)
{
var
video
=
[];
//제품정보를 받고 그안에서 댓글을 받아온다.
...
...
@@ -117,7 +117,7 @@ router.get('/products/detail/:id', function (req, res) {
});
});
}
else
{
console
.
log
(
mitem
);
//
console.log(mitem);
res
.
render
(
'category/productsDetail'
,
{
product
:
product
,
comments
:
comments
,
...
...
@@ -201,7 +201,7 @@ router.get('/products/delete/:id', function (req, res) {
router
.
get
(
'/products/detail/delete/:id'
,
function
(
req
,
res
)
{
VideoModel
.
findOne
({
_id
:
req
.
params
.
id
},
function
(
err
,
products
)
{
VideoModel
.
deleteMany
({
_id
:
products
},
function
(
err
)
{
res
.
redirect
(
'/categori/products/
'
);
res
.
redirect
(
'/categori/products/
detail/'
+
redirectUrls
);
});
});
});
...
...
Please
register
or
login
to post a comment