Skip to content

Commit

Permalink
fix: build error
Browse files Browse the repository at this point in the history
  • Loading branch information
rabyeoljji committed Dec 6, 2024
1 parent b391934 commit 1efebef
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 25 deletions.
4 changes: 3 additions & 1 deletion src/app/(routes)/profile/account/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ const AccountPage = async () => {
<div className="flex flex-col gap-[32px]">
<SetNameDialog userName={user.name} />

<CategoryDrawer interestedCategories={interestFields} />
<CategoryDrawer
interestedCategories={interestFields as (interestedCategory | '관심 분야 없음')[]}
/>

<Link href={'verify-email'} className="flex w-full items-center justify-between">
<div className="flex flex-col items-start gap-[4px]">
Expand Down
20 changes: 10 additions & 10 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,43 +12,43 @@ export const LOCAL_KEY = {

export const CATEGORY_OPTION = [
{
key: 'it',
key: 'IT',
label: 'IT·프로그래밍',
},
{
key: 'law',
key: 'LAW',
label: '법학',
},
{
key: 'business',
key: 'ECONOMY',
label: '경영·경제',
},
{
key: 'social',
key: 'SOCIETY',
label: '사회·정치',
},
{
key: 'language',
key: 'LANGUAGE',
label: '언어',
},
{
key: 'medicine',
key: 'MEDICINE',
label: '의학·약학',
},
{
key: 'art',
key: 'ART',
label: '예술',
},
{
key: 'science',
key: 'SCIENCE',
label: '과학·공학',
},
{
key: 'history',
key: 'HISTORY',
label: '역사·철학',
},
{
key: 'etc',
key: 'ETC',
label: '기타',
},
]
10 changes: 5 additions & 5 deletions src/features/category/components/category-select-area/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const CategorySelectArea = () => {
<Button
id={'BUSINESS_ECONOMY'}
variant={'smallSquare'}
colors={isChecked('BUSINESS_ECONOMY') ? 'selected' : 'outlined'}
colors={isChecked('ECONOMY') ? 'selected' : 'outlined'}
>
💰 경영·경제
</Button>
Expand All @@ -92,7 +92,7 @@ const CategorySelectArea = () => {
<Button
id={'SCIENCE_ENGINEERING'}
variant={'smallSquare'}
colors={isChecked('SCIENCE_ENGINEERING') ? 'selected' : 'outlined'}
colors={isChecked('SCIENCE') ? 'selected' : 'outlined'}
>
🔬 과학·공학
</Button>
Expand All @@ -109,14 +109,14 @@ const CategorySelectArea = () => {
<Button
id={'SOCIETY_POLITICS'}
variant={'smallSquare'}
colors={isChecked('SOCIETY_POLITICS') ? 'selected' : 'outlined'}
colors={isChecked('SOCIETY') ? 'selected' : 'outlined'}
>
⚖️ 사회·정치
</Button>
<Button
id={'HISTORY_PHILOSOPHY'}
variant={'smallSquare'}
colors={isChecked('HISTORY_PHILOSOPHY') ? 'selected' : 'outlined'}
colors={isChecked('HISTORY') ? 'selected' : 'outlined'}
>
📜 역사·철학
</Button>
Expand All @@ -140,7 +140,7 @@ const CategorySelectArea = () => {
<Button
id={'MEDICINE_PHARMACY'}
variant={'smallSquare'}
colors={isChecked('MEDICINE_PHARMACY') ? 'selected' : 'outlined'}
colors={isChecked('MEDICINE') ? 'selected' : 'outlined'}
>
🩺 의학·약학
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Story = StoryObj<typeof CategoryDrawer>

export const Default: Story = {
args: {
interestedCategories: ['IT/프로그래밍'],
interestedCategories: ['IT'],
},
}

Expand Down
8 changes: 6 additions & 2 deletions src/features/user/components/category-drawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ const formSchema = z.object({

type FormValues = z.infer<typeof formSchema>

const CategoryDrawer = ({ interestedCategories }: { interestedCategories?: string[] }) => {
const CategoryDrawer = ({
interestedCategories,
}: {
interestedCategories?: (interestedCategory | '관심 분야 없음')[]
}) => {
const router = useRouter()

const [open, setOpen] = useState(false)
Expand All @@ -47,7 +51,7 @@ const CategoryDrawer = ({ interestedCategories }: { interestedCategories?: strin

const onSubmit = (values: FormValues) => {
mutate(
{ interestCollectionFields: values.categories },
{ interestCollectionFields: values.categories as interestedCategory[] },
{
onSuccess: () => {
setCompleteOpen(true)
Expand Down
12 changes: 6 additions & 6 deletions src/types/user.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ type interestedCategory =
| 'IT'
| 'LAW'
| 'ART'
| 'BUSINESS_ECONOMY'
| 'HISTORY_PHILOSOPHY'
| 'ECONOMY'
| 'HISTORY'
| 'LANGUAGE'
| 'SOCIETY_POLITICS'
| 'MEDICINE_PHARMACY'
| 'SCIENCE_ENGINEERING'
| 'SOCIETY'
| 'MEDICINE'
| 'SCIENCE'
| 'ETC'

interface UserInfo {
Expand All @@ -16,7 +16,7 @@ interface UserInfo {
email: string
socialPlatform: 'KAKAO' | 'GOOGLE'
role: 'ROLE_USER' | 'ROLE_ADMIN'
interestField: string[]
interestField: interestedCategory[]
documentUsage: {
possessDocumentCount: number
maxPossessDocumentCount: number
Expand Down

0 comments on commit 1efebef

Please sign in to comment.