Skip to content
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
2 changes: 1 addition & 1 deletion src/api/client/cookie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const setCookie = (
const {
path = '/',
secure = true,
sameSite = 'Strict',
sameSite = 'Lax', // Strict에서 Lax로 변경: 외부 사이트에서 redirect 시 쿠키 전송 허용
maxAge = 86400, // 1일
httpOnly = false,
} = options;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const PAYMENT_HISTORY_TYPE_MAP: Record<
}
> = {
PAYMENT_REQUESTED: { label: '결제대기', color: 'blue' },
PAYMENT_WAITING_FOR_DEPOSIT: { label: '입금대기', color: 'blue' },
PAYMENT_SUCCESS: { label: '결제완료', color: 'green' },
PAYMENT_FAILED: { label: '결제실패', color: 'red' },
PAYMENT_CANCELED: { label: '결제취소', color: 'red' },
Expand Down
1 change: 1 addition & 0 deletions src/app/(service)/(my)/payment-management/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const TRANSACTION_TYPE_MAP: Record<
}
> = {
PAYMENT_REQUESTED: { label: '결제대기', color: 'blue' },
PAYMENT_WAITING_FOR_DEPOSIT: { label: '입금대기', color: 'blue' },
PAYMENT_SUCCESS: { label: '결제완료', color: 'green' },
PAYMENT_FAILED: { label: '결제실패', color: 'red' },
PAYMENT_CANCELED: { label: '결제취소', color: 'red' },
Expand Down
126 changes: 0 additions & 126 deletions src/app/(service)/payment/complete/page.tsx

This file was deleted.

17 changes: 8 additions & 9 deletions src/components/card/mission-card.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
'use client';

import dayjs from 'dayjs';
import { ComponentProps } from 'react';

import { MissionListResponse } from '@/api/openapi/models';
import Badge from '@/components/ui/badge';
import Button from '@/components/ui/button';
Expand Down Expand Up @@ -42,9 +44,8 @@ const STATUS_CONFIG = {

function formatDate(dateString?: string) {
if (!dateString) return '';
const date = new Date(dateString);

return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`;
return dayjs(dateString).format('YYYY-MM-DD');
}

function getDeadlineInfo(endDate?: string): {
Expand All @@ -53,15 +54,13 @@ function getDeadlineInfo(endDate?: string): {
} | null {
if (!endDate) return null;

const now = new Date();
const end = new Date(endDate);
end.setHours(23, 59, 59, 999);
const now = dayjs();
const end = dayjs(endDate).endOf('day');

const diffMs = end.getTime() - now.getTime();
if (diffMs < 0) return null;
if (end.isBefore(now)) return null;

const diffHours = diffMs / (1000 * 60 * 60);
const diffDays = Math.ceil(diffMs / (1000 * 60 * 60 * 24));
const diffHours = end.diff(now, 'hour');
const diffDays = Math.ceil(end.diff(now, 'day', true));

if (diffHours <= 24) {
return { text: '오늘 제출 마감', isUrgent: true };
Expand Down
2 changes: 1 addition & 1 deletion src/components/contents/homework-detail-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import type {
import Avatar from '@/components/ui/avatar';
import Button from '@/components/ui/button';
import MoreMenu from '@/components/ui/dropdown/more-menu';
import { useUserStore } from '@/stores/useUserStore';
import ConfirmDeleteModal from '@/features/study/group/ui/confirm-delete-modal';
import {
useDeleteHomework,
Expand All @@ -22,6 +21,7 @@ import {
useUpdatePeerReview,
} from '@/hooks/queries/peer-review-api';
import { useIsLeader } from '@/stores/useLeaderStore';
import { useUserStore } from '@/stores/useUserStore';
import DeleteHomeworkModal from '../modals/delete-homework-modal';
import EditHomeworkModal from '../modals/edit-homework-modal';

Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/group-study-list-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import StudyFilter, {
import StudySearch from '@/components/filtering/study-search';
import PageContainer from '@/components/layout/page-container';
import Button from '@/components/ui/button';
import { useAuth } from '@/hooks/common/use-auth';
import { useGetStudies } from '@/hooks/queries/study-query';
import GroupStudyFormModal from '../../features/study/group/ui/group-study-form-modal';
import GroupStudyPagination from '../../features/study/group/ui/group-study-pagination';
import GroupStudyList from '../lists/group-study-list';
import { useAuth } from '@/hooks/common/use-auth';

const PAGE_SIZE = 15;

Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/premium-study-list-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import PremiumStudyList from '@/components/premium/premium-study-list';
import PremiumStudyPagination from '@/components/premium/premium-study-pagination';
import Button from '@/components/ui/button';
import GroupStudyFormModal from '@/features/study/group/ui/group-study-form-modal';
import { useGetStudies } from '@/hooks/queries/study-query';
import { useAuth } from '@/hooks/common/use-auth';
import { useGetStudies } from '@/hooks/queries/study-query';

const PAGE_SIZE = 15;

Expand Down
1 change: 0 additions & 1 deletion src/components/summary/study-info-summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ export default function SummaryStudyInfo({ data }: Props) {
};

const isApplyDisabled =
!isLoggedIn ||
isLeader ||
myApplicationStatus?.status !== 'NONE' ||
groupStudyStatus !== 'RECRUITING' ||
Expand Down
2 changes: 1 addition & 1 deletion src/features/auth/model/use-auth-mutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { useRouter } from 'next/navigation';
import { deleteCookie, getCookie } from '@/api/client/cookie';
import { logout, signUp, uploadProfileImage } from '@/features/auth/api/auth';
import { hashValue } from '@/utils/hash';
import { useUserStore } from '../../../stores/useUserStore';
import { SignUpRequest, SignUpResponse } from './types';
import { useUserStore } from '../../../stores/useUserStore';

// 회원가입 요청 커스텀 훅
export const useSignUpMutation = () => {
Expand Down
6 changes: 3 additions & 3 deletions src/features/my-page/ui/my-study-info-card.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import dayjs from 'dayjs';
import Image from 'next/image';
import Link from 'next/link';
import { IoMdPeople } from 'react-icons/io';
import { LuDot } from 'react-icons/lu';
import Badge from '@/components/ui/badge';
import Button from '@/components/ui/button';
import { MemberStudyItem } from '@/features/study/group/api/group-study-types';
import { formatYYYYMMDD } from '@/utils/time';

interface MyStudyInfoCardProps extends MemberStudyItem {
type: 'GROUP_STUDY';
Expand All @@ -22,8 +22,8 @@ export default function MyStudyInfoCard({
studyRole,
title,
}: MyStudyInfoCardProps) {
const startDate = formatYYYYMMDD(startTime, 'dot');
const endDate = endTime ? formatYYYYMMDD(endTime, 'dot') : null;
const startDate = dayjs(startTime).format('YYYY.MM.DD');
const endDate = endTime ? dayjs(endTime).format('YYYY.MM.DD') : null;

return (
<li className="flex w-full flex-col gap-100">
Expand Down
3 changes: 2 additions & 1 deletion src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export async function middleware(request: NextRequest) {
// 갱신 성공
response.cookies.set('accessToken', newAccessToken, {
secure: true,
sameSite: 'strict',
sameSite: 'lax', // strict에서 lax로 변경: 외부 사이트에서 redirect 시 쿠키 전송 허용
path: '/',
});
} else {
Expand Down Expand Up @@ -156,6 +156,7 @@ export const config = {
'/my-study',
'/my-study-review',
'/sign-up',
'/payment/:path*', // 결제 관련 모든 경로
'/admin/:path*',
],
};
Loading
Loading