Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
festivelo_backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Festivelo
festivelo_backend
Commits
ccb4ac11
Commit
ccb4ac11
authored
6 months ago
by
Jinyeong Kim
Browse files
Options
Downloads
Patches
Plain Diff
recover
parent
0dc0ce35
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
controllers/TripController.js
+5
-17
5 additions, 17 deletions
controllers/TripController.js
with
5 additions
and
17 deletions
controllers/TripController.js
+
5
−
17
View file @
ccb4ac11
...
...
@@ -64,24 +64,12 @@ const deleteTrip = async (req, res) => {
// 공동 작업자 추가
const
addCollaborator
=
async
(
req
,
res
)
=>
{
try
{
const
{
collaboratorEmail
,
collaboratorName
}
=
req
.
body
;
const
{
collaboratorEmail
}
=
req
.
body
;
let
collaborator
;
if
(
collaboratorEmail
)
{
collaborator
=
await
User
.
findOne
({
email
:
collaboratorEmail
});
const
collaborator
=
await
User
.
findOne
({
email
:
collaboratorEmail
});
if
(
!
collaborator
)
{
return
res
.
status
(
404
).
json
({
message
:
'
해당 이메일의 사용자를 찾을 수 없습니다.
'
});
}
}
else
if
(
collaboratorName
)
{
collaborator
=
await
User
.
findOne
({
name
:
collaboratorName
});
if
(
!
collaborator
)
{
return
res
.
status
(
404
).
json
({
message
:
'
해당 이름의 사용자를 찾을 수 없습니다.
'
});
}
return
res
.
status
(
200
).
json
({
email
:
collaborator
.
email
});
}
else
{
return
res
.
status
(
400
).
json
({
message
:
'
이메일 또는 이름을 제공해야 합니다.
'
});
}
const
trip
=
await
Trip
.
findById
(
req
.
params
.
id
).
populate
(
'
create_by
'
);
if
(
!
trip
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment