-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Feat: 이번주 미션 수행여부 컴포넌트 구현
- Loading branch information
Showing
5 changed files
with
140 additions
and
23 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,28 @@ | ||
import axios from 'axios'; | ||
|
||
const fetchMissionStatusWeekly = async (member_id: string) => { | ||
try { | ||
const response = await axios.get('https://www.wishkr.site/emotions/missions/', { | ||
params: { member_id }, | ||
}); | ||
|
||
// response.data가 undefined인지 체크 | ||
if (!response.data) { | ||
console.error('응답 데이터가 없습니다'); | ||
return null; | ||
} | ||
|
||
if (!response.data) { | ||
console.error('result 필드가 없습니다', response.data); | ||
return null; | ||
} | ||
|
||
console.log('주간 미션 현황', response.data); | ||
return response.data; | ||
} catch (error) { | ||
console.error('미션 상태 조회 중 에러 발생:', error); | ||
return null; | ||
} | ||
}; | ||
|
||
export default fetchMissionStatusWeekly; |