-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ✨ Feat: 후원하기 api 기능 구현 * 🔨 Refactor: 모달 디렉토리 배치 * ✨ Feat: 투표하기 api 기능 구현 * 🔨 Refactor: 후원 및 투표 여부 boolean 값으로 변경 * ✨ Feat: 차트모달 로딩, 로딩에러 구현 * 🔨 Refacto: 버튼 안에 로딩스피너 스타일 수정
- Loading branch information
1 parent
b345991
commit 2825653
Showing
10 changed files
with
184 additions
and
55 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { baseAxios } from './api'; | ||
import { votesErrorMessage } from '@/constants/errorMessage'; | ||
|
||
export const postVotes = async (idolId) => { | ||
try { | ||
const response = await baseAxios.post('/votes', { | ||
idolId, | ||
}); | ||
return response.data; | ||
} catch (error) { | ||
throw new Error(votesErrorMessage); | ||
} | ||
}; |
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,13 @@ | ||
import { baseAxios } from './api'; | ||
import { contributeErrorMessage } from '@/constants/errorMessage'; | ||
|
||
export const putContribute = async (id, amount) => { | ||
try { | ||
const response = await baseAxios.put(`/donations/${id}/contribute`, { | ||
amount, | ||
}); | ||
return response.data; | ||
} catch (error) { | ||
throw new Error(contributeErrorMessage); | ||
} | ||
}; |
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 +1,3 @@ | ||
export const loadingErrorMessage = '로딩에 실패하였습니다 \n다시 시도해주세요'; | ||
export const contributeErrorMessage = '후원에 실패하였습니다'; | ||
export const votesErrorMessage = '투표에 실패하였습니다'; |
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
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
Oops, something went wrong.