Skip to content

Commit

Permalink
[feat]태그검색수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jainefer committed Feb 20, 2024
1 parent c1c5f11 commit 0bd64cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/controllers/search.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import jwt from "jsonwebtoken";

export const vidoeSearchKeyWord= async (req,res)=>{
try {
if(req.query.keywordName=" "){

const keyword=req.query.keywordName;
if(keyword===" "){
res.send(response(status.SUCCESS,await viewSearchKeyword({
"videos":[]
})));
Expand All @@ -33,7 +35,7 @@ export const vidoeSearchTag = async (req, res)=>{
const token = req.headers.authorization.split(' ')[1];
const decoded = jwt.verify(token, process.env.JWT_SECRET);
req.userId = decoded.id;
if(req.query.hashtagName=" "){
if(req.query.hashtagName===" "){
res.send(response(status.SUCCESS,await viewSearchKeyword({
"videos":[]
})));
Expand Down
4 changes: 2 additions & 2 deletions src/dtos/search.dto.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const getSearchKeywordResponseDTO = async (video) => {

for (let j = 0; j < video.length; j++) {
for (let i = 0; i < video[j].length; i++) {
console.log("초기단계", videoData[i - 1]?.id);


// 이미 추가된 id인지 체크
if (!addedIds.includes(video[j][i].id)) {
Expand All @@ -33,7 +33,7 @@ export const getSearchKeywordResponseDTO = async (video) => {
}
}
for(let i =0; i<videoData.length;i++){
console.log(i+"번째 영상 ",videoData[i].id);

tagData.push(await getTag({
"videoID":videoData[i].id,
"version":"revision"
Expand Down

0 comments on commit 0bd64cb

Please sign in to comment.