Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat]태그검색수정 #222

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading