-
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.
Merge pull request #380 from SejongPeer/feature/28
feat : [28] 게시글 작성 -> alert & 작성한 스터디 지원자 조회 css & 수락 거절 통신
- Loading branch information
Showing
6 changed files
with
197 additions
and
32 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,24 @@ | ||
import axios from 'axios'; | ||
|
||
export const applicantSelection = async data => { | ||
const accessToken = localStorage.getItem('accessToken'); | ||
const refreshToken = localStorage.getItem('refreshToken'); | ||
|
||
if (!accessToken || !refreshToken) { | ||
throw new Error('Tokens not found in local storage.'); | ||
} | ||
|
||
const response = await axios.patch( | ||
'https://www.api-sejongpeer.shop/api/v1/study/relations/matching/status', | ||
data, | ||
{ | ||
headers: { | ||
Authorization: `Bearer ${accessToken}`, | ||
'Refresh-token': refreshToken, | ||
'Content-Type': 'application/json', | ||
}, | ||
withCredentials: true, | ||
} | ||
); | ||
return response; | ||
}; |
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,24 @@ | ||
import axios from 'axios'; | ||
|
||
export const earlyClose = async studyId => { | ||
const accessToken = localStorage.getItem('accessToken'); | ||
const refreshToken = localStorage.getItem('refreshToken'); | ||
|
||
if (!accessToken || !refreshToken) { | ||
throw new Error('Tokens not found in local storage.'); | ||
} | ||
|
||
const response = await axios.patch( | ||
`https://www.api-sejongpeer.shop/api/v1/study/relations/early-close/${studyId}`, | ||
{}, | ||
{ | ||
headers: { | ||
Authorization: `Bearer ${accessToken}`, | ||
'Refresh-token': refreshToken, | ||
'Content-Type': 'application/json', | ||
}, | ||
// withCredentials: true, | ||
} | ||
); | ||
return response; | ||
}; |
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,23 @@ | ||
import axios from 'axios'; | ||
|
||
export const fetchMyPost = async () => { | ||
const accessToken = localStorage.getItem('accessToken'); | ||
const refreshToken = localStorage.getItem('refreshToken'); | ||
|
||
if (!accessToken || !refreshToken) { | ||
throw new Error('Tokens not found in local storage.'); | ||
} | ||
|
||
const response = await axios.get( | ||
'https://www.api-sejongpeer.shop/api/v1/study/relations/applicants', | ||
{ | ||
headers: { | ||
Authorization: `Bearer ${accessToken}`, | ||
'Refresh-token': refreshToken, | ||
'Content-Type': 'application/json', | ||
}, | ||
withCredentials: true, | ||
} | ||
); | ||
return response.data.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,56 @@ | ||
|
||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import StudyMyPost from '../../../components/studyMyPost/studyMyPost'; | ||
import COLORS from '../../../theme'; | ||
import style from './myPost.module.css'; | ||
|
||
const MyPost = () => { | ||
return ( | ||
<div | ||
className={style.container} | ||
style={{ | ||
backgroundColor: COLORS.back2, | ||
}} | ||
> | ||
<div className={style.innerContainer}> | ||
<div | ||
style={{ | ||
backgroundColor: 'white', | ||
width: '100%', | ||
height: '8%', | ||
marginTop: '7vh', | ||
fontSize: '0.9rem', | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
marginBottom: '8px', | ||
}} | ||
> | ||
<Container> | ||
<InnerContainer> | ||
<Notice> | ||
*모집마감 버튼을 누르면 인원 수와 상관없이 모집이 마감됩니다. | ||
</div> | ||
</Notice> | ||
<StudyMyPost /> | ||
</div> | ||
</div> | ||
</InnerContainer> | ||
</Container> | ||
|
||
); | ||
}; | ||
|
||
export default MyPost; | ||
|
||
const Container = styled.div` | ||
width: 100vw; | ||
height: 100vh; | ||
display: flex; | ||
justify-content: center; | ||
background-color: ${COLORS.back2}; | ||
`; | ||
|
||
const InnerContainer = styled.div` | ||
width: 100vw; | ||
background-color: #fbe4e4; | ||
@media (min-width: 768px) { | ||
width: 674px; | ||
margin-top: 1vh; | ||
} | ||
`; | ||
|
||
const Notice = styled.div` | ||
background-color: white; | ||
width: 100%; | ||
height: 8%; | ||
margin-top: 7vh; | ||
font-size: 0.9rem; | ||
font-weight: 600; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
margin-bottom: 8px; | ||
@media (min-width: 768px) { | ||
font-size: 1.3rem; | ||
} | ||
`; | ||
|
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