-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from teamViNO/feature-022
refactor-022 : search api any 제거
- Loading branch information
Showing
4 changed files
with
8 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<APIResponse<any>>(PREFIX + `/${type}/`, { | ||
return axios.get<APIResponse<ResponseSearch>>(PREFIX + `/${type}/`, { | ||
params : {[paramType] : keyword} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters