Skip to content

Commit

Permalink
fix(fe): fix Vercel problemCard server component error (#1786)
Browse files Browse the repository at this point in the history
* fix(fe): fix vercel problemCards render error

* fix(fe): fix variable name of notice res data

* fix(fe): fix problemRes variable naming
  • Loading branch information
jimin9038 authored Jul 7, 2024
1 parent cf3f4bd commit 641d54a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions apps/frontend/app/(main)/_components/ProblemCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface ProblemCardsProps {
}

const getProblems = async () => {
const problems: ProblemCardsProps = await fetcher
const problemRes: ProblemCardsProps = await fetcher
.get('problem', {
searchParams: {
take: 3
Expand All @@ -19,8 +19,8 @@ const getProblems = async () => {
})
.json()

problems.data ?? console.error('4.getProblem', problems)
return problems.data ?? problems
problemRes.data ?? console.error('4.getProblem', problemRes)
return problemRes.data ?? problemRes
}

export default async function ProblemCards() {
Expand Down
12 changes: 6 additions & 6 deletions apps/frontend/app/(main)/notice/_components/NoticeTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,29 @@ interface NoticeProps {
}

const getFixedNotices = async () => {
const notices: NoticeProps = await fetcher
const fixedNoticesRes: NoticeProps = await fetcher
.get('notice', {
searchParams: {
fixed: 'true',
take: '10'
}
})
.json()
console.log('1. getFixedNotices', notices)
return notices.data ?? notices
console.log('1. getFixedNotices', fixedNoticesRes)
return fixedNoticesRes.data ?? fixedNoticesRes
}

const getNotices = async (search: string) => {
const notices: NoticeProps = await fetcher
const noticesRes: NoticeProps = await fetcher
.get('notice', {
searchParams: {
search,
take: '10'
}
})
.json()
console.log('2. getNotices', notices)
return notices.data ?? notices
console.log('2. getNotices', noticesRes)
return noticesRes.data ?? noticesRes
}

export default async function NoticeTable({ search }: Props) {
Expand Down

0 comments on commit 641d54a

Please sign in to comment.