-
Notifications
You must be signed in to change notification settings - Fork 37
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 #44 from ppamppamman/fe/feature/issues
[FE] 데모 전 핫픽스
- Loading branch information
Showing
6 changed files
with
92 additions
and
8 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
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// useFetch 커스텀훅으로 수정예정 | ||
|
||
const END_POINT = "http://ec2-13-124-158-166.ap-northeast-2.compute.amazonaws.com/api" | ||
|
||
const TOKEN = JSON.parse(localStorage.getItem("issue-tracker-user")); | ||
|
||
const headerMaker = ({token}) => { | ||
return { | ||
headers: { | ||
'Content-Type': 'application/json', | ||
'Authorization': `bearer ${token}` | ||
}, | ||
} | ||
} | ||
|
||
const API = { | ||
get: { | ||
issues: async (query) => { | ||
let targetURL = `${END_POINT}/issues`; | ||
if (query) targetURL += `?searchFilter=${query}`; | ||
return await fetch(targetURL, {...headerMaker({token: TOKEN.accessToken})}).then((response) => { | ||
return response.json(); | ||
}); | ||
// console.log("API call", result); | ||
} | ||
}, | ||
post: {}, | ||
patch: {}, | ||
put: {}, | ||
delete: {} | ||
} | ||
|
||
export default API; |
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