From 869c5013ed418752c2c9cc9d098a293abdb7a033 Mon Sep 17 00:00:00 2001 From: KimSehyeoun Date: Fri, 9 Feb 2024 00:19:39 +0900 Subject: [PATCH 1/3] =?UTF-8?q?any=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/search.ts | 3 ++- src/models/search.ts | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/apis/search.ts b/src/apis/search.ts index 73074cb..3bed108 100644 --- a/src/apis/search.ts +++ b/src/apis/search.ts @@ -1,11 +1,12 @@ import { APIResponse } from '@/models/config/axios'; import axios from './config/instance'; +import { ResponseSearch } from '@/models/search'; const PREFIX = '/search'; export const searchAPI = (type : string, keyword : string) => { const paramType = type === 'keyword' ? 'keywordName' : 'hashtagName'; - return axios.get>(PREFIX + `/${type}/`, { + return axios.get>(PREFIX + `/${type}/`, { params : {[paramType] : keyword} }); } \ No newline at end of file diff --git a/src/models/search.ts b/src/models/search.ts index a57b4ea..7ffb130 100644 --- a/src/models/search.ts +++ b/src/models/search.ts @@ -14,3 +14,7 @@ export interface IVideo { user : string; tag : IName[]; } + +export interface ResponseSearch { + videos : IVideo[]; +} \ No newline at end of file From 5eb50f302056f866efadcb8c23b86c2d52c1ffd4 Mon Sep 17 00:00:00 2001 From: KimSehyeoun Date: Fri, 9 Feb 2024 00:26:15 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=ED=95=B4=EC=89=AC=20=ED=83=9C=EA=B7=B8=201?= =?UTF-8?q?0=EA=B0=9C=20usestate=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/SearchPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/SearchPage.tsx b/src/pages/SearchPage.tsx index 53db40f..710bad1 100644 --- a/src/pages/SearchPage.tsx +++ b/src/pages/SearchPage.tsx @@ -10,7 +10,7 @@ const SearchPage = () => { const [tags, setTags] = useState([]); const [input, setInput] = useState(''); const [searchType, setSearchType] = useState(true); // True : keyword | False : hashTag - const [userHashTag, SetUserHashTag] = useState(["기획", "광고", "마케팅", "트렌드", "기업", "광고", "마케팅", "트렌드", "기업", "광고"]); // 사용자의 해시태그 데이터 10개 <임의 데이터> + const userHashTag = ["기획", "광고", "마케팅", "트렌드", "기업", "광고", "마케팅", "트렌드", "기업", "광고"]; // 사용자의 해시태그 데이터 10개 <임의 데이터> const [selectedHashtags, setSelectedHashtags] = useState([]); const searchNav = useNavigate(); From 08e917e614f2c314ee1de90b1a807a78438a8ed5 Mon Sep 17 00:00:00 2001 From: KimSehyeoun Date: Fri, 9 Feb 2024 00:29:22 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=EB=AF=B8=EC=82=AC=EC=9A=A9=20=EB=AA=A8?= =?UTF-8?q?=EB=93=88=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SearchPage/SearchResultBox.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/SearchPage/SearchResultBox.tsx b/src/components/SearchPage/SearchResultBox.tsx index 21c7731..3a6f853 100644 --- a/src/components/SearchPage/SearchResultBox.tsx +++ b/src/components/SearchPage/SearchResultBox.tsx @@ -1,6 +1,6 @@ import { IVideo } from '@/models/search'; import Styled from '@/styles/SearchResult'; -import React, { ImgHTMLAttributes } from 'react'; +import React from 'react'; interface SearchResultBoxProp { video : IVideo