Skip to content

Commit

Permalink
fix: 세부 페이지 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyoeunkh committed May 20, 2024
1 parent fcabc37 commit 3a3f076
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/pages/BoothDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ export default function BoothDetailPage() {

return (
<DetailPageWrapper>
{isPending ? <Loader /> : boothDetail && <BoothInfo boothDetail={boothDetail} />}

{boothDetail?.boothDescription.split("<br/>").map((detail) => {
{isPending ? <Loader /> : boothDetail && <BoothInfo boothDetail={boothDetail} /> }
{(boothDetail?.boothDescription!=null?boothDetail.boothDescription:'').split("<br/>").map((detail) => {
return (
<Paragraph size="m" weight="normal">
{detail}
Expand Down
2 changes: 2 additions & 0 deletions src/services/booth/booth.hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ export const useBoothDetail = () => {
const [boothDetail, setBoothDetail] = useState<IReadBoothByIdResponse | null>(null);

useEffect(() => {
if (!visitorId) return;

setIsPending(true);
boothService
.readBoothById(category as string, parseInt(boothId as string), visitorId as string)
Expand Down
2 changes: 1 addition & 1 deletion src/services/booth/booth.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ export interface IReadBoothByIdResponse {
boothnum: number;
urls: string[];
likable: boolean;
boothDescription: string;
boothDescription?: string;
}
8 changes: 5 additions & 3 deletions src/utils/parseCreatedDate.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
export const parseCreatedDate = (str: string) => {
// 2024-05-19T03:18:40.33581

const [date, time] = str.split("T");
console.log(str);
if(!str) return '';

const [date, time] = (str||'').split("T");
const [y, m, d] = date.split("-");
const t = time.split(".")[0];

return `${y}${m}${d}${t}`;
return `${y}${m}${d}${t}`
};

0 comments on commit 3a3f076

Please sign in to comment.