-
SCSS-searchProject using node.js/Cloning Youtube 2020. 9. 2. 12:22
pages/search.scss
.search__header { margin-bottom: 30px; h5 { font-weight: 600; &:first-child { margin-bottom: 20px; } } } .search__videos { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); grid-gap: 30px; .videoBlock:first-child, .videoBlock:nth-child(2) { grid-column: span 3; } .videoBlock:nth-child(3), .videoBlock:nth-child(4), .videoBlock:nth-child(5) { grid-column: span 2; } }
View
videoController.js - search
Video.find()로 video를 가져오는 부분에서 populate('creator')로 user 객체를 가져오는 코드를 추가했다.
참고 자료
소스 코드
https://github.com/zpskek/wetube-v3/commit/8c96821fd41ca241728ea10372a47184c4b4f51f
'Project using node.js > Cloning Youtube' 카테고리의 다른 글
JavaScript video play button (0) 2020.09.03 SCSS-videoPlayer (0) 2020.09.03 SCSS-videoDetail (0) 2020.09.02 SCSS-userDetail (0) 2020.09.02 SCSS-socialLogin (0) 2020.09.02