Skip to content

Commit 0edde47

Browse files
committed
fix: Reducer 티켓 옵션 응답 형식 타입 수정 및 optionId 안정성 검증 추가
1 parent 2ae1767 commit 0edde47

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/features/ticket/hooks/useTicketOptionForm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const useTicketOptionForm = () => {
1313
const { id: eventId, optionId } = useParams();
1414
const { mutate: createTicketOptionMutation } = useCreateTicketOptionMutation();
1515
const { mutate: modifyTicketOptionMutation } = useModifyTicketOptionMutation();
16-
const { data: optionDetail, isLoading } = useGetTicketOptionDetail(Number(optionId));
16+
const { data: optionDetail, isLoading } = useGetTicketOptionDetail(optionId ? Number(optionId) : 0);
1717
const isEditing = !!optionId;
1818
const editOption = optionDetail?.result;
1919

src/features/ticket/model/ticketOption.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export type Action =
2828
| { type: 'SET_WARNING'; payload: { field: keyof State['warnings']; value: string } } // 경고 메시지
2929
| { type: 'SET_QUESTION_TITLE'; payload: string } // 질문 제목 업데이트
3030
| { type: 'SET_DESCRIPTION'; payload: string } // 질문 설명 업데이트
31-
| { type: 'SET_RESPONSE_TOGGLE'; payload: string } // 응답 형식 토글
31+
| { type: 'SET_RESPONSE_TOGGLE'; payload: TicketOptionType } // 응답 형식 토글
3232
| { type: 'TOGGLE_ANSWER' } // 필수 응답 여부 토글
3333
| { type: 'SET_FOCUSED_INDEX'; payload: number | null } // 포커싱된 옵션 인덱스 변경
3434
| { type: 'UPDATE_OPTION'; payload: { index: number; value: string; isSingle: boolean } } // 추가 옵션의 텍스트를 수정

src/features/ticket/model/ticketOptionReducer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function ticketOptionReducer(state: State, action: Action): State {
5454
...state,
5555
question: {
5656
...state.question,
57-
responseFormat: action.payload as TicketOptionType,
57+
responseFormat: action.payload,
5858
},
5959
};
6060
case 'TOGGLE_ANSWER':

0 commit comments

Comments
 (0)