-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
105 additions
and
128 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
import { getToken } from '@src/utils'; | ||
import axios from 'axios'; | ||
|
||
const jigumeAxios = axios.create({ | ||
export const jigumeAxios = axios.create({ | ||
headers: { | ||
Authorization: `Bearer ${getToken().accessToken}`, | ||
withCredentials: true, | ||
crossDomain: true, | ||
credentials: 'include', | ||
}, | ||
}); | ||
export default jigumeAxios; | ||
|
||
export const axiosHeaderAuth = { | ||
Authorization: `Bearer ${getToken().accessToken}`, | ||
}; |
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 |
---|---|---|
@@ -1,20 +1,26 @@ | ||
import { MemberInfoDto } from '@src/types/user'; | ||
import { OrderHistoryDto, SellHistoryDto } from '@src/types/mypage'; | ||
import jigumeAxios from './axios'; | ||
import { axiosHeaderAuth, jigumeAxios } from './axios'; | ||
|
||
export const getProfile = async (): Promise<MemberInfoDto> => { | ||
const response = await jigumeAxios.get('/api/member/profile'); | ||
const response = await jigumeAxios.get('/api/member/profile', { | ||
headers: axiosHeaderAuth, | ||
}); | ||
|
||
return response.data; | ||
}; | ||
|
||
export const getProgressLead = async (): Promise<SellHistoryDto[]> => { | ||
const response = await jigumeAxios.get('/api/sell/PROCESSING'); | ||
const response = await jigumeAxios.get('/api/sell/PROCESSING', { | ||
headers: axiosHeaderAuth, | ||
}); | ||
|
||
return response.data; | ||
}; | ||
|
||
export const getProgressJoin = async (): Promise<OrderHistoryDto[]> => { | ||
const response = await jigumeAxios.get('/api/order/PROCESSING'); | ||
const response = await jigumeAxios.get('/api/order/PROCESSING', { | ||
headers: axiosHeaderAuth, | ||
}); | ||
return response.data; | ||
}; |
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.