Skip to content

Commit

Permalink
Merge pull request #712 from Kernel360/fix-mypage-schema
Browse files Browse the repository at this point in the history
Fix mypage schema
  • Loading branch information
hatchling13 authored Mar 28, 2024
2 parents abd91f8 + ba0bd55 commit ed52ae8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface TExistingSpot {
spot_id: number;
image_url: string;
rate: number;
created_date: string;
created_date: Date;
place_name: string;
}

Expand Down Expand Up @@ -54,7 +54,7 @@ export default function ExistPlaceItem({
rating
/>
<div className="text-gray-300 font-bold">
{new Date(created_date).toLocaleDateString('ko-KR')}
{created_date.toLocaleDateString('ko-KR')}
</div>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/app/_components/mypage/spot/MyPageSpotItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ const MyPageSpotItem = ({
count={rate}
rating
/>
<div className="text-gray-300 font-bold">{created_date}</div>
<div className="text-gray-300 font-bold">
{created_date.toLocaleDateString('ko-kr')}
</div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import ToastMsg from '../ui/toast/ToastMsg';
import { MemberContext } from '@/context/MemberContext';
import { NextPublicContext } from '@/context/NextPublicContext';

const BASE_URL =
process.env.ENVIRONMENT === 'production'
? process.env.NEXT_PUBLIC_BASE_URL
: process.env.NEXT_PUBLIC_DEV_BASE_URL;

export default function NotificationIcon() {
const memberStatus = useContext(MemberContext);
const [newData, setNewData] = useState('');
Expand Down Expand Up @@ -40,7 +35,7 @@ export default function NotificationIcon() {

return () => eventSource.close();
}
}, [user]);
}, [user, baseUrl]);

const { push } = useRouter();
return (
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/types/myPageResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ export const myPageSpotItemSchema = z.object({
place_name: z.string(),
is_private: z.boolean(),
image_url: z.string(),
created_date: z.coerce
.date()
.transform((date) => date.toLocaleDateString('ko-kr')),
created_date: z.coerce.date(),
// .transform((date) => date.toLocaleDateString('ko-kr')),
rate: z.number(),
});

Expand Down

0 comments on commit ed52ae8

Please sign in to comment.