From 48f9c3ae11fb2f37a000f13640d3cdcacc05018b Mon Sep 17 00:00:00 2001 From: pjookim <pjookim@naver.com> Date: Wed, 4 Dec 2024 23:37:00 +0900 Subject: [PATCH] Enhance trip creation by adding location field in TripController --- controllers/TripController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/TripController.js b/controllers/TripController.js index 9d0493e..58304dc 100644 --- a/controllers/TripController.js +++ b/controllers/TripController.js @@ -25,8 +25,8 @@ const getTripById = async (req, res) => { // 새로운 여행 계획 생성 const createTrip = async (req, res) => { try { - const { name, start_date, end_date, create_by, collaborators } = req.body; - const trip = new Trip({ name, start_date, end_date, create_by, collaborators }); + const { name, start_date, end_date, create_by, location, collaborators } = req.body; + const trip = new Trip({ name, start_date, end_date, create_by, location, collaborators }); const savedTrip = await trip.save(); res.status(201).json(savedTrip); } catch (err) { -- GitLab