-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(fe): change problem cards component to server component (#2240)
* refactor(fe): change problem cards component to server component * chore(fe): add todo comment * chore(fe): remove info column * chore(fe): change order search parameter to required
- Loading branch information
Showing
6 changed files
with
63 additions
and
80 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
90 changes: 24 additions & 66 deletions
90
apps/frontend/app/(client)/(main)/_components/ProblemCards.tsx
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
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,24 @@ | ||
import { safeFetcher } from '@/libs/utils' | ||
import type { Problem } from '@/types/type' | ||
import type { PaginationQueryParams } from './types' | ||
|
||
export interface GetProblemListRequest extends PaginationQueryParams { | ||
search?: string | ||
order: string | ||
} | ||
|
||
export interface GetProblemListResponse { | ||
data: Problem[] | ||
total: number | ||
} | ||
|
||
export const getProblemList = async ({ | ||
...searchParams | ||
}: GetProblemListRequest) => { | ||
const response = await safeFetcher.get('problem', { | ||
searchParams | ||
}) | ||
const data = await response.json<GetProblemListResponse>() | ||
|
||
return data | ||
} |
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