Skip to content

Commit

Permalink
정보 상세 페이지 날짜 표시 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
HyunJinNo committed Jul 17, 2024
1 parent de90e0e commit 1340a76
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
7 changes: 7 additions & 0 deletions src/app/informations/write/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import PagePath from "@/components/common/PagePath";
import InformationEditorContainer from "@/containers/informations/write/InformationEditorContainer";
import { Metadata } from "next";
import { cookies } from "next/headers";
import { redirect } from "next/navigation";

export const metadata: Metadata = {
title: "정보 등록하기",
description: "Solitour의 정보 등록하기 페이지",
};

export default function page() {
const cookie = cookies().get("access_token");
if (!cookie) {
redirect("/auth/signin");
}

return (
<div className="flex flex-col items-center">
<PagePath first="정보" second={"정보 등록하기"} />
Expand Down
4 changes: 2 additions & 2 deletions src/components/informations/detail/InformationViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const InformationViewer = async ({ informationId }: Props) => {
{data.userPostingResponse.name}
</p>
<p className="text-xs text-gray1 dark:text-slate-400">
{`${data.createdDate}`}
{`${new Date(data.createdDate).toLocaleDateString()}`}
</p>
</div>
</div>
Expand Down Expand Up @@ -91,7 +91,7 @@ const InformationViewer = async ({ informationId }: Props) => {
{data.userPostingResponse.name}
</p>
<p className="text-xs text-gray1 dark:text-slate-400">
{`${data.createdDate}`}
{`${new Date(data.createdDate).toLocaleDateString()}`}
</p>
</div>
</div>
Expand Down
12 changes: 6 additions & 6 deletions src/containers/common/HeaderContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ const HeaderContainer = () => {
// 자동 로그인
const login = async () => {
const data = await fetchWithAuth("/api/auth/user");
if (data.status == 200) {
data.json().then((res: userResponseDto) => {
authStore.setUser(res);
});
}
if (data.status == 200) {
data.json().then((res: userResponseDto) => {
authStore.setUser(res);
});
}
};
login();
login();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

Expand Down

0 comments on commit 1340a76

Please sign in to comment.