diff --git a/frontend/src/api/admin/concert.js b/frontend/src/api/admin/concert.js new file mode 100644 index 0000000..fce0101 --- /dev/null +++ b/frontend/src/api/admin/concert.js @@ -0,0 +1,13 @@ +/** + * 콘서트 관리자 API + */ +import { fetchFormData } from '@/api/client'; + +/** + * 콘서트 일정 생성 + * @param {FormData} formData - 콘서트 데이터 + * @returns {Promise<{success: boolean, seriesId: number}>} + */ +export async function createConcertSchedule(formData) { + return fetchFormData('/admin/concert/schedule', formData, 'POST'); +} diff --git a/frontend/src/components/pc/admin/common/VenueSearchDialog.jsx b/frontend/src/components/pc/admin/common/VenueSearchDialog.jsx index 7e0968e..e3e83ba 100644 --- a/frontend/src/components/pc/admin/common/VenueSearchDialog.jsx +++ b/frontend/src/components/pc/admin/common/VenueSearchDialog.jsx @@ -63,7 +63,7 @@ function VenueSearchDialog({ isOpen, onClose, onSelect }) { id: place.id, name: place.place_name, address: place.road_address_name || place.address_name, - country: "한국", + country: "South Korea", lat: parseFloat(place.y), lng: parseFloat(place.x), category: place.category_name, diff --git a/frontend/src/pages/pc/admin/schedules/form/concert/ScheduleSection.jsx b/frontend/src/pages/pc/admin/schedules/form/concert/ScheduleSection.jsx index efa1fa1..4476590 100644 --- a/frontend/src/pages/pc/admin/schedules/form/concert/ScheduleSection.jsx +++ b/frontend/src/pages/pc/admin/schedules/form/concert/ScheduleSection.jsx @@ -31,6 +31,13 @@ function ScheduleSection({ rounds, setRounds }) { roundId: null, }); + // 장소 삭제 확인 다이얼로그 + const [venueDeleteConfirm, setVenueDeleteConfirm] = useState({ + isOpen: false, + roundId: null, + venueName: null, + }); + // 회차 추가 const addRound = () => { const newRound = { @@ -107,9 +114,24 @@ function ScheduleSection({ rounds, setRounds }) { setLocationSearch({ isOpen: false, roundId: null }); }; - // 장소 제거 - const removeVenue = (roundId) => { - updateRound(roundId, "venue", null); + // 장소 삭제 시도 + const handleRemoveVenue = (roundId) => { + const round = rounds.find((r) => r.id === roundId); + if (round?.venue) { + setVenueDeleteConfirm({ + isOpen: true, + roundId, + venueName: round.venue.name, + }); + } + }; + + // 장소 삭제 확인 + const handleConfirmVenueDelete = () => { + if (venueDeleteConfirm.roundId !== null) { + updateRound(venueDeleteConfirm.roundId, "venue", null); + } + setVenueDeleteConfirm({ isOpen: false, roundId: null, venueName: null }); }; return ( @@ -141,6 +163,24 @@ function ScheduleSection({ rounds, setRounds }) { onSelect={handleLocationSelect} /> + {/* 장소 삭제 확인 다이얼로그 */} + + setVenueDeleteConfirm({ isOpen: false, roundId: null, venueName: null }) + } + onConfirm={handleConfirmVenueDelete} + title="장소 삭제" + message={ +

+ {venueDeleteConfirm.venueName} + 을(를) 삭제하시겠습니까? +

+ } + confirmText="삭제" + cancelText="취소" + /> +

공연 일정

@@ -221,7 +261,7 @@ function ScheduleSection({ rounds, setRounds }) {