-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat: 사전 용어 목록 조회 구현
- Loading branch information
Showing
13 changed files
with
223 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { get } from '@/lib/axios' | ||
import { SuccessResponse } from '@/types/response' | ||
import { FilterType, SimpleWordType } from '@/types/word' | ||
|
||
export async function getAllWords( | ||
category: FilterType, | ||
sortBy: string | undefined, | ||
) { | ||
const res = await get<SuccessResponse<SimpleWordType[]>>( | ||
`/words?category=${category}&sortBy=${sortBy}`, | ||
) | ||
return res.words | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import WordListItem from '@/components/shared/WordListItem' | ||
import { words } from '@/components/shared/WordListItem/data' | ||
import { FilterType, SimpleWordType } from '@/types/word' | ||
import { SimpleWordType } from '@/types/word' | ||
|
||
type WordsListProps = { | ||
category: FilterType | ||
words: SimpleWordType[] | ||
} | ||
|
||
export default function WordsList({ category }: WordsListProps) { | ||
export default function WordsList({ words }: WordsListProps) { | ||
return ( | ||
<> | ||
{words.map((word: SimpleWordType, idx: number) => ( | ||
<WordListItem key={word.id} word={word} /> | ||
))} | ||
{words && | ||
words.map((word: SimpleWordType, idx: number) => ( | ||
<WordListItem key={word.id} word={word} /> | ||
))} | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
'use client' | ||
import Image from 'next/image' | ||
import React from 'react' | ||
|
||
|
Oops, something went wrong.