Skip to content

Commit

Permalink
해쉬태그 api 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
sehyun0518 committed Feb 17, 2024
1 parent c96a7aa commit 08b6cf5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/apis/search.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { APIResponse } from '@/models/config/axios';
import axios from './config/instance';
import { ResponseSearch } from '@/models/search';
import { ITag, ResponseSearch } from '@/models/search';

const PREFIX = '/search';

Expand All @@ -9,4 +9,8 @@ export const searchAPI = (type : string, keyword : string) => {
return axios.get<APIResponse<ResponseSearch>>(PREFIX + `/${type}/`, {
params : {[paramType] : keyword}
});
}

export const tagAPI = () => {
return axios.get<APIResponse<ITag[]>>('/videos/tag');
}
7 changes: 6 additions & 1 deletion src/models/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ export interface IVideo {

export interface ResponseSearch {
videos : IVideo[];
}
}

export interface ITag {
id : number;
name : string;
}

0 comments on commit 08b6cf5

Please sign in to comment.