Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mypage schema #712

Merged
merged 4 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading