Skip to content

Commit

Permalink
[fix] 상세는 또 필드명이 다르네...
Browse files Browse the repository at this point in the history
  • Loading branch information
zestlee1106 committed Oct 19, 2023
1 parent bb1a716 commit d6cb203
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion components/RoomCard/RoomCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export default function RoomCard({ room, onClick }: CardProps) {
return (
<Card
title={<UserInfo userInfo={room?.user} />}
content={<Photo photos={room.images} onClick={onClick} />}
content={<Photo photos={room.images || []} onClick={onClick} />}
footer={<Footer room={room} />}
/>
);
Expand Down
6 changes: 3 additions & 3 deletions pages/room/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,21 +206,21 @@ export default function RoomDetail() {
{room && (
<>
<div className="font-pretendard w-full mb-[71px]">
{room.images.length > 0 ? (
{(room.imageFiles || []).length > 0 ? (
<Swiper
effect="coverflow"
slidesPerView={1}
loop
className="mySwiper !mx-[-20px] h-[240px] relative"
onSlideChangeTransitionEnd={(event) => handleSlideChange(event.realIndex)}
>
{room.images.map((image, idx) => (
{(room.imageFiles || []).map((image, idx) => (
<SwiperSlide className={styles['swiper-slide']} key={`room-image-${idx}`}>
<img src={image.path} alt={`room-${idx}`} />
</SwiperSlide>
))}
<div className={styles.tag}>
{currentSlide + 1}/{room.images.length}
{currentSlide + 1}/{(room.imageFiles || []).length}
</div>
</Swiper>
) : (
Expand Down
3 changes: 2 additions & 1 deletion public/types/room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ export interface RoomSearch {
furnishings: FurnishingData[];
availableDate: string;
description: string;
images: ImageFile[];
images?: ImageFile[];
imageFiles?: ImageFile[];
user: User;
furnishingsData?: string[];
}
Expand Down

0 comments on commit d6cb203

Please sign in to comment.