Skip to content

Commit

Permalink
URL 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
alaneelee committed Jan 10, 2024
1 parent a053aea commit 60e11ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/modal/DonationModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const Donation = ({ closeModal, streamerId }) => {

const fetchData = async () => {
try {
const response = await axios.get('http://localhost:8081/api/point', {
const response = await axios.get(`${process.env.REACT_APP_API_URL}/api/point`, {
headers: {
Authorization: accessToken,
},
Expand Down Expand Up @@ -139,7 +139,7 @@ const Donation = ({ closeModal, streamerId }) => {

try {
const response = await axios.post(
`http://localhost:8081/api/${streamerId}/donations`,
`${process.env.REACT_APP_API_URL}/api/${streamerId}/donations`,
donationData,
{
headers: {
Expand Down
17 changes: 10 additions & 7 deletions src/modal/PaymentsModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,14 @@ const PaymentsModal = ({ closeModal }) => {

const fetchData = async () => {
try {
const response = await axios.get('http://localhost:8081/api/point', {
headers: {
Authorization: accessToken,
},
});
const response = await axios.get(
`${process.env.REACT_APP_API_URL}/api/point`,
{
headers: {
Authorization: accessToken,
},
}
);
setPointData(response.data);
console.log('GET 요청 성공:', response.data);
} catch (error) {
Expand All @@ -123,7 +126,7 @@ const PaymentsModal = ({ closeModal }) => {
const sendAmountToServer = async (amount) => {
try {
const response = await axios.post(
'http://localhost:8081/api/point',
`${process.env.REACT_APP_API_URL}/api/point`,
{
point: amount,
},
Expand Down Expand Up @@ -160,7 +163,7 @@ const PaymentsModal = ({ closeModal }) => {
async (rsp) => {
try {
const { data } = await axios.post(
'http://localhost:8081/verifyIamport/' + rsp.imp_uid
`${process.env.REACT_APP_API_URL}/verifyIamport/` + rsp.imp_uid
);
if (rsp.paid_amount === data.response.amount) {
alert('결제 성공');
Expand Down

0 comments on commit 60e11ed

Please sign in to comment.