Skip to content

Commit

Permalink
Merge pull request #231 from BCSDLab/fix/#230-fix_approval_modal
Browse files Browse the repository at this point in the history
Fix: 모달 창 안 뜨는 문제 해결
  • Loading branch information
kimeodml authored Apr 10, 2024
2 parents e3d6aa2 + df190c7 commit 646c36c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/page/Auth/Login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function Login() {
const { login, isError: isServerError } = useLogin();
const [isFormError, setIsFormError] = useState(false);
const navigate = useNavigate();
const { loginError, loginErrorCode } = useErrorMessageStore();
const { loginError, loginErrorStatus } = useErrorMessageStore();
const [emailError, setEmailError] = useState('');
const { value: isModalOpen, changeValue: toggle } = useBooleanState(false);

Expand Down Expand Up @@ -135,7 +135,7 @@ export default function Login() {
</div>
</form>
</div>
{loginErrorCode === 100005 && isModalOpen && <ApprovalModal toggle={toggle} />}
{loginErrorStatus === 403 && isModalOpen && <ApprovalModal toggle={toggle} />}
</div>
);
}
2 changes: 1 addition & 1 deletion src/page/MyShopPage/components/EditShopInfoModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ EditShopInfoModalProps) {
<label htmlFor="deliveryPrice" className={styles['main-info']}>
<span className={styles['main-info__header']}>배달금액</span>
<input
type="text"
type="number"
id="deliveryPrice"
value={deliveryPrice === 0 ? '' : deliveryPrice}
onChange={(e) => setDeliveryPrice(Number(e.target.value))}
Expand Down
2 changes: 1 addition & 1 deletion src/page/ShopRegistration/view/Mobile/Sub/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default function Sub() {
>
배달금액
<input
type="text"
type="number"
id="deliveryPrice"
onChange={(e) => setDeliveryPrice(Number(e.target.value))}
value={deliveryPrice}
Expand Down
4 changes: 2 additions & 2 deletions src/query/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface ErrorResponse {
export const useLogin = () => {
const navigate = useNavigate();
const { setPrevPath } = usePrevPathStore((state) => state);
const { setLoginError, setLoginErrorCode } = useErrorMessageStore();
const { setLoginError, setLoginErrorStatus } = useErrorMessageStore();
const setStep = useStepStore((state) => state.setStep);

const { mutate, error, isError } = useMutation({
Expand Down Expand Up @@ -64,7 +64,7 @@ export const useLogin = () => {
sessionStorage.removeItem('access_token');
localStorage.removeItem('refresh_token');
setLoginError(err.message || '로그인에 실패했습니다.');
setLoginErrorCode(err.code);
setLoginErrorStatus(err.status);
}
},
});
Expand Down
8 changes: 4 additions & 4 deletions src/store/errorMessageStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ interface ErrorMessageStore {
setCategoryError: (error: string) => void;
loginError: string;
setLoginError: (error: string) => void;
loginErrorCode: number;
setLoginErrorCode: (error: number) => void;
loginErrorStatus: number;
setLoginErrorStatus: (error: number) => void;
}

export const useErrorMessageStore = create<ErrorMessageStore>((set) => ({
Expand All @@ -18,6 +18,6 @@ export const useErrorMessageStore = create<ErrorMessageStore>((set) => ({
setCategoryError: (error) => set({ categoryError: error }),
loginError: '',
setLoginError: (error) => set({ loginError: error }),
loginErrorCode: 0,
setLoginErrorCode: (error) => set({ loginErrorCode: error }),
loginErrorStatus: 0,
setLoginErrorStatus: (error) => set({ loginErrorStatus: error }),
}));

0 comments on commit 646c36c

Please sign in to comment.