diff --git a/src/pages/register/MRegisterForm.tsx b/src/pages/register/MRegisterForm.tsx index 1241bcf5..dbd1d200 100644 --- a/src/pages/register/MRegisterForm.tsx +++ b/src/pages/register/MRegisterForm.tsx @@ -59,9 +59,11 @@ const MRegisterForm = () => { const tempPetInfo = { ...petInfo, [fieldName]: newValue }; const allFieldsFilled = Object.values(tempPetInfo).every((value, index) => { // isComplete는 petInfo의 모든 필드가 채워져 있을 때 true - if (index === Object.values(petInfo).length - 1) { + if ( + Object.keys(tempPetInfo)[index] === 'isComplete' || + Object.keys(tempPetInfo)[index] === 'protectionExpirationDate' + ) return true; - } return !!value; }); if (allFieldsFilled) { diff --git a/src/pages/register/RegisterHeader.tsx b/src/pages/register/RegisterHeader.tsx index 16daec36..f3b1f46c 100644 --- a/src/pages/register/RegisterHeader.tsx +++ b/src/pages/register/RegisterHeader.tsx @@ -43,6 +43,7 @@ const RegisterHeader = () => { }; const { data, mutate, isError, isLoading, isSuccess } = useMutation(postPet); const handleRegisterButtonClick = async () => { + console.log(registerPetData); if (!selectedImageFile || !selectedVideoFile || !registerPetData.isComplete) return; const formData = new FormData(); diff --git a/src/pages/register/StatusSelectGroup.tsx b/src/pages/register/StatusSelectGroup.tsx index 36be27ce..ae962503 100644 --- a/src/pages/register/StatusSelectGroup.tsx +++ b/src/pages/register/StatusSelectGroup.tsx @@ -19,9 +19,9 @@ const StatusSelectGroup = () => { setIntelligenceOption(option); setProfileStatus((prev) => ({ ...prev, - polygonProfile: { + petPolygonProfileDto: { ...prev.petPolygonProfileDto, - intelligence: Number(option), + intelligence: option, }, })); break; @@ -29,9 +29,9 @@ const StatusSelectGroup = () => { setAffinityOption(option); setProfileStatus((prev) => ({ ...prev, - polygonProfile: { + petPolygonProfileDto: { ...prev.petPolygonProfileDto, - affinity: Number(option), + affinity: option, }, })); break; @@ -39,9 +39,9 @@ const StatusSelectGroup = () => { setAthleticOption(option); setProfileStatus((prev) => ({ ...prev, - polygonProfile: { + petPolygonProfileDto: { ...prev.petPolygonProfileDto, - athletic: Number(option), + athletic: option, }, })); break; @@ -49,9 +49,9 @@ const StatusSelectGroup = () => { setAdaptabilityOption(option); setProfileStatus((prev) => ({ ...prev, - polygonProfile: { + petPolygonProfileDto: { ...prev.petPolygonProfileDto, - adaptability: Number(option), + adaptability: option, }, })); break; @@ -59,9 +59,9 @@ const StatusSelectGroup = () => { setActivenessOption(option); setProfileStatus((prev) => ({ ...prev, - polygonProfile: { + petPolygonProfileDto: { ...prev.petPolygonProfileDto, - activeness: Number(option), + activeness: option, }, })); break;