Skip to content
Snippets Groups Projects
Commit 48f9c3ae authored by pjookim's avatar pjookim
Browse files

Enhance trip creation by adding location field in TripController

parent 34329a4a
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment