Skip to content
Snippets Groups Projects
Commit f1565101 authored by Jinyeong Kim's avatar Jinyeong Kim
Browse files

fix collaborator

parent 4bce4590
No related branches found
No related tags found
1 merge request!15Hi
......@@ -85,7 +85,7 @@ const addCollaborator = async (req, res) => {
return res.status(400).json({ message: 'Creator cannot be added as a collaborator' });
}
trip.collaborators.push({ email: collaboratorEmail, name: user.name });
trip.collaborators.push({ email: collaboratorEmail });
await trip.save();
res.status(200).json(trip);
} catch (err) {
......
......@@ -27,8 +27,7 @@ const tripSchema = new mongoose.Schema({
location: { type: String, required: true },
create_by: { type: mongoose.Schema.Types.ObjectId, ref: 'User', required: true },
collaborators: [{
email: { type: String, required: true },
name: { type: String, required: true },
email: { type: String, required: true }
}],
plans: {
type: Map, // Object 대신 Map 사용
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment