-
Notifications
You must be signed in to change notification settings - Fork 2
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 #41 from Happy-Dreaming/feature/24
[#24] 꿈 일기 api
- Loading branch information
Showing
11 changed files
with
281 additions
and
226 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
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import axios from "axios"; | ||
import { GET } from "../refresh_token/route"; | ||
|
||
/* | ||
<search 관련 api> | ||
1. 꿈 일기 검색 | ||
2. 꿈 해몽 검색 | ||
*/ | ||
|
||
// [get] 꿈 일기 검색 | ||
export const getSearchDiary = async (search: string, page: number) => { | ||
try { | ||
const response = await axios({ | ||
method: "GET", | ||
url: "/api/diaries", | ||
params: { | ||
search: search, | ||
page: page, | ||
}, | ||
}); | ||
// 응답 결과 : 다이어리[] | ||
console.log(response.data); | ||
|
||
return response.data; | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
}; | ||
|
||
// [get] 꿈 해몽 검색 | ||
export const getSearchDictionary = async ( | ||
keyword: string, | ||
page: number, | ||
pageSize: number | ||
) => { | ||
try { | ||
const response = await axios({ | ||
method: "GET", | ||
url: `/api/dictionary/search`, | ||
params: { | ||
keyword: keyword, | ||
page: page, | ||
pageSize: pageSize, | ||
}, | ||
}); | ||
// 응답 결과 : 꿈 해몽[] | ||
console.log(response.data); | ||
|
||
return response.data; | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
}; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,6 @@ const useAxios = <T>( | |
fetchData(); | ||
}, []); | ||
|
||
|
||
return { | ||
data, | ||
loading, | ||
|
Oops, something went wrong.