-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Feat: ProjectRetro 그룹 삭제 기능 구현 (#318)
* ✨ Feat: ProjectRetro 개별 그룹 조회 api 연결 * 🐛 Fix: 렌더링 오류 * 💄 Design: ProjectRetro 그룹 삭제 모달창 퍼블리싱 * ✨ Feat: ProjectRetro 그룹 삭제 api 연결
- Loading branch information
Showing
14 changed files
with
273 additions
and
37 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { DeleteRetrospectiveRequest } from '@/api/@types/Groups'; | ||
import axiosInstance from '@/api/axiosConfig'; | ||
|
||
export const DeleteGroup = async ({ retrospectiveGroupId }: DeleteRetrospectiveRequest): Promise<void> => { | ||
try { | ||
const response = await axiosInstance.delete(`/retrospectiveGroups/${retrospectiveGroupId}`); | ||
return response.data; | ||
} catch (error) { | ||
throw new Error(error as string); | ||
} | ||
}; |
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,19 @@ | ||
import { GetRetrospectiveGroupRequest, GetRetrospectiveGroupResponse } from '@/api/@types/Groups'; | ||
import axiosInstance from '@/api/axiosConfig'; | ||
|
||
export const GetRetrospectiveGroup = async ({ | ||
retrospectiveGroupId, | ||
...request | ||
}: GetRetrospectiveGroupRequest): Promise<GetRetrospectiveGroupResponse> => { | ||
try { | ||
const response = await axiosInstance.get<GetRetrospectiveGroupResponse>( | ||
`/retrospectiveGroups/${retrospectiveGroupId}`, | ||
request, | ||
); | ||
return response.data; | ||
} catch (error) { | ||
throw new Error('단일 그룹 조회 실패'); | ||
} | ||
}; | ||
|
||
export default GetRetrospectiveGroup; |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { IoMdClose } from 'react-icons/io'; | ||
import { RiFolder6Fill } from 'react-icons/ri'; | ||
import { DeleteGroup } from '@/api/retroGroupsApi/deleteGroup'; | ||
import { useCustomToast } from '@/hooks/useCustomToast'; | ||
import * as S from '@/styles/projectRetro/DeleteModal.styles'; | ||
|
||
interface DeleteModalProps { | ||
isClose: () => void; | ||
modalClose: () => void; | ||
groupId: number; | ||
} | ||
|
||
const DeleteModal: React.FC<DeleteModalProps> = ({ isClose, modalClose, groupId }) => { | ||
const toast = useCustomToast(); | ||
const handleDeleteGroup = async () => { | ||
try { | ||
await DeleteGroup({ retrospectiveGroupId: groupId }); | ||
setTimeout(() => { | ||
isClose(); | ||
modalClose(); | ||
toast.info('그룹이 삭제되었습니다.'); | ||
}, 1000); | ||
} catch (e) { | ||
toast.error('그룹 삭제에 실패했습니다.'); | ||
} | ||
}; | ||
|
||
return ( | ||
<S.Background> | ||
<S.Container> | ||
<S.Modal> | ||
<S.Top> | ||
<S.Title>회고 프로젝트 삭제</S.Title> | ||
<IoMdClose | ||
onClick={isClose} | ||
size={20} | ||
style={{ color: '#6c6c6c', marginLeft: 'auto', cursor: 'pointer' }} | ||
/> | ||
</S.Top> | ||
<hr /> | ||
<S.Bottom> | ||
<div style={{ display: 'flex', alignItems: 'center' }}> | ||
<RiFolder6Fill size={25} style={{ color: '#FFE500', padding: 0 }} /> | ||
<S.ProjectName>프로젝트1</S.ProjectName> {/* 프로젝트 이름 */} | ||
<S.Text>를 삭제하시겠습니까?</S.Text> | ||
</div> | ||
<S.Button onClick={handleDeleteGroup}>Delete</S.Button> | ||
</S.Bottom> | ||
</S.Modal> | ||
</S.Container> | ||
</S.Background> | ||
); | ||
}; | ||
|
||
export default DeleteModal; |
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.