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 23, 2024
1 parent c6dc521 commit ae12368
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/app/(routes)/profile/(main)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const ProfilePage = async () => {
{user.interestCategories.map((category) => (
<CategoryTag
key={category}
title={CATEGORIES.find((value) => value.code === category)?.name ?? ''}
title={CATEGORIES.find((value) => value.id === category)?.name ?? ''}
className="flex-center"
></CategoryTag>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ interface Props {
collectionId: number
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const CollectionInfoDropdownMenu = ({ collectionId }: Props) => {
return (
<DropdownMenu>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ interface Props {
collectionId: number
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const MyCollectionInfoDropdownMenu = ({ collectionId }: Props) => {
return (
<DropdownMenu>
Expand Down
2 changes: 1 addition & 1 deletion src/features/quiz/screen/random-quiz-view/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const RandomQuizView = ({ directories }: Props) => {
[randomCollectionQuizzesData?.quizzes]
)

const { data: randomDirectoryQuizzesData } = useDirectoryQuizzes(activeDirectoryId)
const { data: randomDirectoryQuizzesData } = useDirectoryQuizzes(activeDirectoryId ?? null)
const randomDirectoryQuizzes = useMemo(
() => randomDirectoryQuizzesData?.quizzes ?? [],
[randomDirectoryQuizzesData?.quizzes]
Expand Down
2 changes: 1 addition & 1 deletion src/features/user/components/category-drawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const CategoryDrawer = ({
{interestedCategories.map((category) => (
<CategoryTag
key={category}
title={CATEGORIES.find((value) => value.code === category)?.name ?? ''}
title={CATEGORIES.find((value) => value.id === category)?.name ?? ''}
className="text-text-secondary"
/>
))}
Expand Down
2 changes: 1 addition & 1 deletion src/features/user/components/info-card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const UserInfoCard = () => {
{user.interestCategories.map((category) => (
<CategoryTag
key={category}
title={CATEGORIES.find((value) => value.code === category)?.name ?? ''}
title={CATEGORIES.find((value) => value.id === category)?.name ?? ''}
className="flex-center"
></CategoryTag>
))}
Expand Down
2 changes: 1 addition & 1 deletion src/requests/directory/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const getDirectories = async () => {
/**
* directory_id로 디렉토리 가져오기
*/
export const fetchDirectory = async (directoryId: Directory.Item['id']) => {
export const getDirectory = async (directoryId: Directory.Item['id']) => {
try {
const { data } = await http.get<Directory.Response.GetDirectory>(
API_ENDPOINTS.DIRECTORY.GET.BY_ID(directoryId)
Expand Down
4 changes: 2 additions & 2 deletions src/requests/directory/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
createDirectory,
deleteDirectory,
getDirectories,
fetchDirectory,
getDirectory,
updateDirectoryInfo,
} from './client'
import { getQueryClient } from '@/shared/lib/tanstack-query/client'
Expand All @@ -27,7 +27,7 @@ export const useDirectories = () => {
export const useDirectory = (directoryId: Directory.Item['id']) => {
return useQuery({
queryKey: ['directory', directoryId],
queryFn: async () => fetchDirectory(directoryId),
queryFn: async () => getDirectory(directoryId),
})
}

Expand Down
2 changes: 1 addition & 1 deletion src/requests/quiz/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
// })
// }

export const useDirectoryQuizzes = (directoryId?: number) => {
export const useDirectoryQuizzes = (directoryId: number | null) => {
return useQuery({
queryKey: ['directoryQuizzes', directoryId],
queryFn: async () => getDirectoryQuizzes({ directoryId: directoryId! }),
Expand Down
4 changes: 2 additions & 2 deletions src/shared/lib/tanstack-query/query-keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ export const queries = createQueryKeyStore({
directory: {
list: () => ({
queryKey: [''],
queryFn: () => REQUEST.directory.fetchDirectories(),
queryFn: () => REQUEST.directory.getDirectories(),
}),
item: (directoryId: number) => ({
queryKey: [directoryId],
queryFn: () => REQUEST.directory.fetchDirectory(directoryId),
queryFn: () => REQUEST.directory.getDirectory(directoryId),
enabled: !!directoryId,
}),
},
Expand Down

0 comments on commit ae12368

Please sign in to comment.