diff --git a/src/components/Common/CompleteTrip.tsx b/src/components/Common/CompleteTrip.tsx index ec5a7c3..d989162 100644 --- a/src/components/Common/CompleteTrip.tsx +++ b/src/components/Common/CompleteTrip.tsx @@ -1,10 +1,31 @@ -export default function CompleteTrip() { +import planService, { Plan } from "@/services/planService"; + +interface CompleteTripProps { + planDetail: Plan; + closeModal: () => void; +} + +export default function CompleteTrip({ planDetail, closeModal }: CompleteTripProps) { + async function handleSubmit() { + try { + await planService.completePlan(planDetail.id); + alert("여행이 완료되었습니다!"); + window.location.reload(); + closeModal(); + } catch (error) { + console.error(`여행 완료에 실패 하였습니다. ${error}`); + } + } + return (

여행을 완료하시겠습니까?

-
diff --git a/src/components/MyPlans/Cards/PlanCard.tsx b/src/components/MyPlans/Cards/PlanCard.tsx index 06b1d5a..e0ab800 100644 --- a/src/components/MyPlans/Cards/PlanCard.tsx +++ b/src/components/MyPlans/Cards/PlanCard.tsx @@ -9,10 +9,13 @@ interface PlanData { export default function PlanCard({ planDetail }: PlanData) { return ( -
-
+
+
-
-
-
-
-