Skip to content

Commit

Permalink
Merge pull request #197 from DNDACADEMY/develop
Browse files Browse the repository at this point in the history
fix: admin blob url이 달라서 빌드이후 404떨어지는 이슈 (#196)
  • Loading branch information
saseungmin authored Sep 25, 2024
2 parents 4a2ae58 + 5195f22 commit 855b097
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 22 deletions.
25 changes: 14 additions & 11 deletions apps/admin/src/app/current-applicant-count/page.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
import { CurrentApplicantCount } from '@dnd-academy/core';
import { headers } from 'next/headers';

import { api, CurrentApplicantCount } from '@dnd-academy/core';
import { Counter, PageTitle } from '@dnd-academy/ui';
import { withServerErrorBoundary } from '@dnd-academy/ui/server';

import CurrentApplicantCountAction from '@/components/CurrentApplicantCountAction';

import styles from './page.module.scss';

type Props = {
data: CurrentApplicantCount;
};
async function Page() {
const headersList = headers();
const host = headersList.get('host');

const protocol = process.env.NODE_ENV === 'production' ? 'https' : 'http';

const currentApplicantCountData = await api<CurrentApplicantCount>({
url: `${protocol}://${host}/api/blob/latest/current_applicant_count`,
});

async function Page({ data }: Props) {
const { designer, developer } = data;
const { designer, developer } = currentApplicantCountData;

return (
<>
Expand All @@ -32,7 +38,4 @@ async function Page({ data }: Props) {
);
}

export default withServerErrorBoundary(Page, {
url: '/blob/latest/current_applicant_count',
type: 'bff',
});
export default Page;
25 changes: 14 additions & 11 deletions apps/admin/src/app/total-count-status/page.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
import { type TotalCountStatus } from '@dnd-academy/core';
import { headers } from 'next/headers';

import { api, type TotalCountStatus } from '@dnd-academy/core';
import { CounterCard, PageTitle } from '@dnd-academy/ui';
import { withServerErrorBoundary } from '@dnd-academy/ui/server';

import TotalCountStatusForm from '@/components/TotalCountStatusForm';

import styles from './page.module.scss';

type Props = {
data: TotalCountStatus;
};
async function Page() {
const headersList = headers();
const host = headersList.get('host');

const protocol = process.env.NODE_ENV === 'production' ? 'https' : 'http';

const totalCountStatus = await api<TotalCountStatus>({
url: `${protocol}://${host}/api//blob/latest/total_count_status`,
});

async function Page({ data }: Props) {
const {
cumulativeApplicants, dropouts, totalParticipants, totalProjects,
} = data;
} = totalCountStatus;

return (
<>
Expand All @@ -35,7 +41,4 @@ async function Page({ data }: Props) {
);
}

export default withServerErrorBoundary(Page, {
url: '/blob/latest/total_count_status',
type: 'bff',
});
export default Page;

0 comments on commit 855b097

Please sign in to comment.