diff --git a/src/containers/group/create/CreateGroup.tsx b/src/containers/group/create/CreateGroup.tsx index d19649e..f6cc886 100644 --- a/src/containers/group/create/CreateGroup.tsx +++ b/src/containers/group/create/CreateGroup.tsx @@ -105,7 +105,7 @@ export default function CreateGroup() { address: formik.values.address, businessNumber: formik.values.businessNumber, email: formik.values.email, - imageUrl: "defaultGroup.png", + imageUrl: "groupDefault.png", }; const response = await createGroup(requestCreateGroup); @@ -114,6 +114,7 @@ export default function CreateGroup() { } else { alert("그룹 생성에 실패했습니다."); } + window.location.href = "/group"; }; const requestCheckDuplicateGroupName = async () => { diff --git a/src/containers/group/detail/GroupDetail.module.css b/src/containers/group/detail/GroupDetail.module.css index dd12fde..af0666f 100644 --- a/src/containers/group/detail/GroupDetail.module.css +++ b/src/containers/group/detail/GroupDetail.module.css @@ -13,6 +13,10 @@ transform: translate(-50%, -50%); } +.left_bar { + min-width: 19rem; +} + .group_title { font-size: 35px; font-weight: 700; diff --git a/src/containers/group/detail/GroupDetail.tsx b/src/containers/group/detail/GroupDetail.tsx index 40015f6..919b03e 100644 --- a/src/containers/group/detail/GroupDetail.tsx +++ b/src/containers/group/detail/GroupDetail.tsx @@ -110,7 +110,7 @@ export default function GroupDetail() { <> {groupData ? (
-
+

{groupData.name}

{ - const response = deleteGroup(props.id); + const requestDeleteGroup = async () => { + if (!confirm("정말로 그룹을 삭제하시겠습니까?")) { + return; + } + const response = await deleteGroup(props.id); if (!response) { console.error("[Error] 그룹 정보 삭제 실패"); } + if (response.status === 200) { + alert("그룹이 삭제되었습니다."); + window.location.href = "/group"; + } }; return ( diff --git a/src/services/group/group.ts b/src/services/group/group.ts index 4196db5..a7c8603 100644 --- a/src/services/group/group.ts +++ b/src/services/group/group.ts @@ -129,9 +129,10 @@ export const deleteGroup = async (groupId: number) => { "Authorization": `Bearer ${localStorage.getItem("accessToken")}`, }, }); - return response.status === 200; + return { status: 200 }; } catch (error) { console.error(error); + return { status: 500 }; } };