diff --git a/src/components/Space/SpaceForm.tsx b/src/components/Space/SpaceForm.tsx index 38144cd8..16f24bca 100644 --- a/src/components/Space/SpaceForm.tsx +++ b/src/components/Space/SpaceForm.tsx @@ -74,26 +74,30 @@ const SpaceForm = ({ spaceType, space }: SpaceFormProps) => {
{ - if (spaceType === 'Create') { - const { spaceId } = await feachCreateSpace(data, imageFile) - notify('info', '스페이스가 생성되었습니다.') - router.replace(`/space/${spaceId}`) - } else if (spaceType === 'Setting') { - try { - const response = await fetchSettingSpace(spaceId, data, imageFile) - if (!response.spaceId) { + if (data.category === '') { + notify('error', '카테고리를 선택해 주세요.') + } else { + if (spaceType === 'Create') { + const { spaceId } = await feachCreateSpace(data, imageFile) + notify('info', '스페이스가 생성되었습니다.') + router.replace(`/space/${spaceId}`) + } else if (spaceType === 'Setting') { + try { + const response = await fetchSettingSpace(spaceId, data, imageFile) + if (!response.spaceId) { + router.replace('/') + return + } + notify('info', '스페이스를 수정했습니다.') + router.push(`/space/${response.spaceId}`) + } catch (e) { router.replace('/') - return } - notify('info', '스페이스를 수정했습니다.') + } else { + const response = await fetchScrapSpace(spaceId, data, imageFile) + notify('info', '스페이스가 생성되었습니다.') router.push(`/space/${response.spaceId}`) - } catch (e) { - router.replace('/') } - } else { - const response = await fetchScrapSpace(spaceId, data, imageFile) - notify('info', '스페이스가 생성되었습니다.') - router.push(`/space/${response.spaceId}`) } })}>
diff --git a/src/components/common/Space/Space.tsx b/src/components/common/Space/Space.tsx index 7a2429d8..ddae0d5c 100644 --- a/src/components/common/Space/Space.tsx +++ b/src/components/common/Space/Space.tsx @@ -88,7 +88,7 @@ const Space = ({ {spaceName}
-
+
{description}