Skip to content

Commit

Permalink
Merge pull request #61 from ej070961/develop
Browse files Browse the repository at this point in the history
fix: api 경로수정
  • Loading branch information
ej070961 authored Aug 10, 2024
2 parents 31fd21a + 9cc609b commit 4201226
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions src/apis/sponsor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const postAddressItem = async (
) => {
try {
const res = await axiosInstance.post(
"/api/v1/supports",
"/supports",
{
title: data.title,
reason: data.reason,
Expand Down Expand Up @@ -52,7 +52,7 @@ export const postAccountItem = async (
) => {
try {
const res = await axiosInstance.post(
"/api/v1/supports",
"/supports",
{
title: data.title,
reason: data.reason,
Expand Down Expand Up @@ -89,7 +89,7 @@ export const postAccountItem = async (

export const getAddress = async (accesstoken: string) => {
try {
const res = await axiosInstance.get("/api/v1/canary/delivery", {
const res = await axiosInstance.get("/canary/delivery", {
headers: {
Authorization: `Bearer ${accesstoken}`,
// 다른 헤더를 추가할 수 있습니다.
Expand Down Expand Up @@ -118,7 +118,7 @@ export const getPagingPost = async (
.map((category) => `category=${encodeURIComponent(category)}`)
.join("&");

let url = `/api/v1/public/supports/paging?page=${page}&${queryCategoryString}&status=${status}`;
let url = `/public/supports/paging?page=${page}&${queryCategoryString}&status=${status}`;
if (keyword) {
url += `&q=${encodeURIComponent(keyword)}`;
}
Expand All @@ -143,7 +143,7 @@ export const getPagingPost = async (
export const getDeadlinePost = async () => {
try {
const res = await axiosInstance.get(
`/api/v1/public/supports/deadline-approaching`
`/public/supports/deadline-approaching`
);
return res.data.data;
} catch (error) {
Expand All @@ -158,7 +158,7 @@ export const getDeadlinePost = async () => {

export const getSupportsInfo = async (supportId: string) => {
try {
const res = await axiosInstance.get(`/api/v1/public/supports/${supportId}`);
const res = await axiosInstance.get(`/public/supports/${supportId}`);
return res.data.data;
} catch (error) {
console.log(error);
Expand All @@ -173,7 +173,7 @@ export const getSupportsInfo = async (supportId: string) => {
export const getProgressInfo = async (supportId: string) => {
try {
const res = await axiosInstance.get(
`/api/v1/public/supports/${supportId}/progress`
`/public/supports/${supportId}/progress`
);
return res.data.data;
} catch (error) {
Expand All @@ -188,7 +188,7 @@ export const getProgressInfo = async (supportId: string) => {

export const getCanaryInfo = async (memberId: number) => {
try {
const res = await axiosInstance.get(`/api/v1/canary/${memberId}/supports`);
const res = await axiosInstance.get(`/canary/${memberId}/supports`);
return res.data.data;
} catch (error) {
console.log(error);
Expand All @@ -205,7 +205,7 @@ export const deleteSupportPost = async (
accesstoken: string
) => {
try {
const res = await axiosInstance.delete(`/api/v1/supports/${supportId}`, {
const res = await axiosInstance.delete(`/supports/${supportId}`, {
headers: {
Authorization: `Bearer ${accesstoken}`,
},
Expand All @@ -231,7 +231,7 @@ export const postDonate = async (
const bankName = banks.find((b) => b.id === bankcode);
try {
const res = await axiosInstance.post(
`/api/v1/supports/${supportId}/record`,
`/supports/${supportId}/record`,
{
bankName: bankName?.label,
bankCode: bankcode,
Expand Down Expand Up @@ -259,14 +259,11 @@ export const postDonate = async (

export const getUpdate = async (supportId: string, accesstoken: string) => {
try {
const res = await axiosInstance.get(
`/api/v1/supports/${supportId}/update`,
{
headers: {
Authorization: `Bearer ${accesstoken}`,
},
}
);
const res = await axiosInstance.get(`/supports/${supportId}/update`, {
headers: {
Authorization: `Bearer ${accesstoken}`,
},
});
return res.data;
} catch (error) {
console.log(error);
Expand All @@ -285,7 +282,7 @@ export const updateAddressItem = async (
) => {
try {
const res = await axiosInstance.put(
`/api/v1/supports/${supportId}`,
`/supports/${supportId}`,
{
title: data.title,
reason: data.reason,
Expand Down Expand Up @@ -328,7 +325,7 @@ export const updateAccountItem = async (
) => {
try {
const res = await axiosInstance.put(
`/api/v1/supports/${supportId}`,
`/supports/${supportId}`,
{
title: data.title,
reason: data.reason,
Expand Down

0 comments on commit 4201226

Please sign in to comment.