diff --git a/frontend/src/components/public/JoinDialog.vue b/frontend/src/components/public/JoinDialog.vue index 5397e85..5c6f7bb 100644 --- a/frontend/src/components/public/JoinDialog.vue +++ b/frontend/src/components/public/JoinDialog.vue @@ -56,22 +56,18 @@
- +
+
+ + -
-
- - -
-
@@ -80,8 +76,8 @@ import { - STATUS_OPTIONS, GENDER_OPTIONS, + PARTICIPANT_STATUS_OPTIONS, PAYMENT_STATUS_OPTIONS, getGenderLabel, - getMemberTypeLabel, - getStatusLabel, - getPaymentStatusLabel + getMemberTypeLabel } from '@/utils/enumMappings'; import { ref, computed, watch } from 'vue'; import Tag from 'primevue/tag'; @@ -178,7 +172,7 @@ const memberOptions = computed(() => { const nameB = b.name || ''; return nameA.localeCompare(nameB, 'ko'); }); - if (props.eventStatus === '준비') { + if (props.eventStatus === 'ready') { baseOptions.push({ name: '신규 게스트 추가', isNewGuest: true }); } return baseOptions; @@ -206,32 +200,22 @@ const paymentStatus = ref(''); const error = ref(''); const submitted = ref(false); -const statusOptions = [ - { label: getStatusLabel('참가예정'), value: '참가예정' }, - { label: getStatusLabel('참가확정'), value: '참가확정' }, - { label: getStatusLabel('취소'), value: '취소' } -]; -const paymentStatusOptions = [ - { label: getPaymentStatusLabel('미납'), value: '미납' }, - { label: getPaymentStatusLabel('납부완료'), value: '납부완료' } -]; const newGuest = ref({ name: '', phone: '', gender: '' }); import PublicEventService from '@/services/PublicEventService'; async function addNewGuest() { error.value = ''; - if (!newGuest.value.name || !newGuest.value.phone || !newGuest.value.gender) { - error.value = '이름, 연락처, 성별을 모두 입력하세요.'; + if (!newGuest.value.name || !newGuest.value.gender) { + error.value = '이름, 성별을 모두 입력하세요.'; return; } try { // 실제 API 경로/파라미터는 상황에 맞게 수정 필요 const res = await PublicEventService.createGuest(props.publicHash, { name: newGuest.value.name, - phone: newGuest.value.phone, - gender: newGuest.value.gender, - average: newGuest.value.average + phone: newGuest.value.phone || null, + gender: newGuest.value.gender }); if (!res || !res.data || !res.data.memberId) throw new Error('게스트 등록 실패'); @@ -242,8 +226,8 @@ async function addNewGuest() { id: res.data.participantId, participantId: res.data.participantId, memberId: res.data.memberId, - status: res.data.status || '참가예정', // 참가 확정 상태 추가 - paymentStatus: res.data.paymentStatus || '미납', // 결제 상태 추가 + status: res.data.status || 'pending', // 참가 확정 상태 추가 + paymentStatus: res.data.paymentStatus || 'unpaid', // 결제 상태 추가 Member: { name: newGuest.value.name, gender: newGuest.value.gender, @@ -284,13 +268,12 @@ async function addNewGuest() { selectedMemberId.value = guest.memberId; // 참가 상태와 회비 납부 상태 자동 선택 - console.log(guest); status.value = guest.status; paymentStatus.value = guest.paymentStatus; comment.value = guest.comment || ''; // 입력폼 초기화 - newGuest.value = { name: '', phone: '', gender: '', average: '' }; + newGuest.value = { name: '', phone: '', gender: '' }; // 부모 컴포넌트에 이벤트 발생 emits('guest-added', guest); diff --git a/frontend/src/utils/enumMappings.js b/frontend/src/utils/enumMappings.js index e75b6e4..fd293b0 100644 --- a/frontend/src/utils/enumMappings.js +++ b/frontend/src/utils/enumMappings.js @@ -82,9 +82,7 @@ export const EVENT_TYPE_LABELS = EVENT_TYPE_OPTIONS.reduce( export const PAYMENT_STATUS_OPTIONS = [ { name: '미납', value: 'unpaid' }, - { name: '납부완료', value: 'paid' }, - { name: '대기', value: 'pending' }, - { name: '취소', value: 'canceled' } + { name: '납부완료', value: 'paid' } ]; export const PAYMENT_STATUS_LABELS = PAYMENT_STATUS_OPTIONS.reduce( (acc, cur) => ({ ...acc, [cur.value]: cur.name }),