Skip to content

Commit

Permalink
fix: 상세 등록 뒤로 가기 기능 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
bottlewook committed Mar 4, 2024
1 parent 224cfff commit 0a1c9d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/app/(car-details)/car-details/hydrated-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { useCallback, useState } from 'react';
import { useForm } from 'react-hook-form';

import { useRouter } from 'next/router';
import { useRouter } from 'next/navigation';

import CarColorPicker from '@components/additional-info/car-details/CarColorPicker';
import CarDetails from '@components/additional-info/car-details/CarDetails';
Expand Down Expand Up @@ -45,9 +45,8 @@ function CarDetailsPage() {
if (step === 1) {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
router.push('/my-page');
} else {
setStep((currentStep) => { return currentStep - 1; });
}
setStep((currentStep) => { return currentStep - 1; });
}, [router, step]);

// eslint-disable-next-line @typescript-eslint/require-await
Expand Down
5 changes: 2 additions & 3 deletions src/app/(car-details)/car-wash-details/hydrated-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { useCallback, useState } from 'react';
import { useForm } from 'react-hook-form';

import { useRouter } from 'next/router';
import { useRouter } from 'next/navigation';

import CarDetails from '@components/additional-info/car-details/CarDetails';
import DetailsLoading from '@components/additional-info/details-loading/DetailsLoading';
Expand Down Expand Up @@ -40,9 +40,8 @@ function CarWashDetailsPage() {
if (step === 1) {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
router.push('/my-page');
} else {
setStep((currentStep) => { return currentStep - 1; });
}
setStep((currentStep) => { return currentStep - 1; });
}, [router, step]);

// eslint-disable-next-line @typescript-eslint/require-await
Expand Down

0 comments on commit 0a1c9d3

Please sign in to comment.