Skip to content

Commit

Permalink
#202 chore: change magic number to constant
Browse files Browse the repository at this point in the history
  • Loading branch information
wuzoo committed Aug 12, 2024
1 parent b545520 commit f1b84a1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"^axios(.*)",
"^msw(.*)",
"^@/common/(.*)$",
"^@/pages/(.*)$",
"^@/page/(.*)$",
"^@/shared/(.*)$",
"^@/story/(.*)$",
"^@/mock/(.*)$",
Expand Down
4 changes: 2 additions & 2 deletions src/page/signUp/info/hook/common/useDateInput.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getFormatDateString, getFormatNumberString, isValidDate } from '@/page/signUp/info/util/date';

import { ChangeEvent, useCallback, useState } from 'react';

import { getFormatDateString, getFormatNumberString, isValidDate } from '@/page/signUp/info/util/date';

import { DATE_MAXLENGTH, FORMATTED_DATE_MAXLENGTH } from '@/shared/constant/form';

export const useDateInput = () => {
Expand Down
6 changes: 3 additions & 3 deletions src/page/signUp/info/hook/common/useInfoForm.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { getFormatDateString, getFormatNumberString, isValidDate } from '@/page/signUp/info/util/date';

import { ChangeEvent, FormEvent, useCallback, useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';

import { useError, useOverlay } from '@/common/hook';

import { getFormatDateString, getFormatNumberString, isValidDate } from '@/page/signUp/info/util/date';

import { UserInfo } from '@/shared/api/signup/info/type';
import { DATE_MAXLENGTH, FORMATTED_DATE_MAXLENGTH, SUPPORTING_TEXT } from '@/shared/constant/form';
import { PATH } from '@/shared/constant/path';
Expand Down Expand Up @@ -77,7 +77,7 @@ export const useInfoForm = () => {
if (value.length === DATE_MAXLENGTH && info.birth.length === FORMATTED_DATE_MAXLENGTH) {
value = info.birth.replace(/-/g, '');
} else {
value = getFormatDateString(getFormatNumberString(value, 8));
value = getFormatDateString(getFormatNumberString(value, DATE_MAXLENGTH));
}

setInfo((prev) => ({
Expand Down
6 changes: 3 additions & 3 deletions src/page/signUp/info/hook/common/usePasswordForm.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useSignupMutation } from '@/page/signUp/info/hook/api/useSignupMutation';
import { InfoFormData } from '@/page/signUp/info/hook/common/useInfoForm';

import { ChangeEvent, FormEvent, useCallback, useState } from 'react';

import { useError } from '@/common/hook';

import { useSignupMutation } from '@/page/signUp/info/hook/api/useSignupMutation';
import { InfoFormData } from '@/page/signUp/info/hook/common/useInfoForm';

import { UserInfo } from '@/shared/api/signup/info/type';
import { PASSWORD_VALID_FORMAT, SUPPORTING_TEXT } from '@/shared/constant/form';
import { hasKeyInObject } from '@/shared/util/typeGuard';
Expand Down

0 comments on commit f1b84a1

Please sign in to comment.