Skip to content
Open
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
10 changes: 10 additions & 0 deletions src/api/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*/
export const ErrorCode = {
// Global - 기본 에러
SERVER_ERROR: 'E000',
INVALID_ENUM_VALUE: 'E001',
INVALID_REQUEST_FORMAT: 'E002',
STATUS_ALREADY_SET: 'E003',
Expand Down Expand Up @@ -110,6 +111,8 @@ export const ErrorCode = {
INVALID_MAX_PARTICIPANTS: 'M013',
MAX_PARTICIPANTS_LESS_THAN_CURRENT: 'M014',
MEETING_DELETE_NOT_ALLOWED: 'M015',
MEETING_JOIN_TIME_EXPIRED: 'M016',
MEETING_UPDATE_TIME_EXPIRED: 'M017',

// Topic
TOPIC_NOT_FOUND: 'E101',
Expand All @@ -127,6 +130,8 @@ export const ErrorCode = {
MEETING_RETROSPECTIVE_NOT_FOUND: 'R103',
RETROSPECTIVE_ALREADY_DELETED: 'R104',
NO_ACCESS_RETROSPECTIVE: 'R105',
AI_SUMMARY_NOT_FOUND: 'R106',
RETROSPECTIVE_ALREADY_CREATED: 'R108',

// Storage
STORAGE_FILE_UPLOAD_FAILED: 'S001',
Expand Down Expand Up @@ -164,6 +169,7 @@ export type ErrorCodeType = (typeof ErrorCode)[keyof typeof ErrorCode]
*/
export const ErrorMessage: Record<ErrorCodeType, string> = {
// Global - 기본 에러
[ErrorCode.SERVER_ERROR]: '서버 에러가 발생했습니다. 담당자에게 문의 바랍니다.',
[ErrorCode.INVALID_ENUM_VALUE]: '유효하지 않은 값입니다.',
[ErrorCode.INVALID_REQUEST_FORMAT]: '잘못된 요청 형식입니다.',
[ErrorCode.STATUS_ALREADY_SET]: '이미 해당 상태입니다.',
Expand Down Expand Up @@ -250,6 +256,8 @@ export const ErrorMessage: Record<ErrorCodeType, string> = {
[ErrorCode.MAX_PARTICIPANTS_LESS_THAN_CURRENT]:
'현재 참가 확정된 인원 수보다 적게 수정할 수 없습니다.',
[ErrorCode.MEETING_DELETE_NOT_ALLOWED]: '약속 시작 24시간 이내에는 삭제할 수 없습니다.',
[ErrorCode.MEETING_JOIN_TIME_EXPIRED]: '약속 시작 24시간 이내에는 참가 신청할 수 없습니다.',
[ErrorCode.MEETING_UPDATE_TIME_EXPIRED]: '약속 시작 24시간 이내에는 수정할 수 없습니다.',

// Topic
[ErrorCode.TOPIC_NOT_FOUND]: '주제를 찾을 수 없습니다.',
Expand All @@ -267,6 +275,8 @@ export const ErrorMessage: Record<ErrorCodeType, string> = {
[ErrorCode.MEETING_RETROSPECTIVE_NOT_FOUND]: '공동 회고 내용을 찾을 수 없습니다.',
[ErrorCode.RETROSPECTIVE_ALREADY_DELETED]: '이미 삭제된 개인 회고입니다.',
[ErrorCode.NO_ACCESS_RETROSPECTIVE]: '회고에 접근할 권한이 없습니다.',
[ErrorCode.AI_SUMMARY_NOT_FOUND]: 'AI 요약을 찾을 수 없습니다.',
[ErrorCode.RETROSPECTIVE_ALREADY_CREATED]: '이미 약속 회고가 생성되었습니다.',

// Storage
[ErrorCode.STORAGE_FILE_UPLOAD_FAILED]: '파일 업로드에 실패했습니다.',
Expand Down
1 change: 1 addition & 0 deletions src/features/meetings/meetings.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ export interface MyMeetingListItem {
meetingStatus: MeetingStatus | 'REJECTED' | 'DONE'
myRole: MyMeetingRole
progressStatus: MyMeetingProgressStatus
preOpinionTemplateConfirmed: boolean
}

/** 메인페이지 내 약속 커서 */
Expand Down
12 changes: 9 additions & 3 deletions src/pages/Home/components/HomeMeetingCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export default function HomeMeetingCard({ meeting }: HomeMeetingCardProps) {
endDateTime,
myRole,
progressStatus,
preOpinionTemplateConfirmed,
} = meeting

const status = STATUS_CONFIG[progressStatus]
Expand All @@ -56,7 +57,7 @@ export default function HomeMeetingCard({ meeting }: HomeMeetingCardProps) {

const handleActionClick = (e: MouseEvent) => {
e.stopPropagation()
if (isUpcoming) {
if (isUpcoming && preOpinionTemplateConfirmed) {
navigate(ROUTES.PRE_OPINIONS(gatheringId, meetingId))
}
// TODO: 종료 → 개인 회고 작성 페이지 연결
Expand Down Expand Up @@ -110,9 +111,14 @@ export default function HomeMeetingCard({ meeting }: HomeMeetingCardProps) {
</div>

{/* 액션 버튼 */}
{/* TODO: API 응답에 hasPreOpinionTemplate 필드 추가 후, 템플릿 미제작 시 disabled 처리 */}
{isUpcoming && (
<Button variant="primary" size="small" className="shrink-0" onClick={handleActionClick}>
<Button
variant="primary"
size="small"
className="shrink-0"
disabled={!preOpinionTemplateConfirmed}
onClick={handleActionClick}
>
사전 의견 작성하기
</Button>
)}
Expand Down
Loading