Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
WebBack
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
websystem
WebBack
Commits
d6a423cc
Commit
d6a423cc
authored
5 months ago
by
조대희
Browse files
Options
Downloads
Patches
Plain Diff
refactor: 미팅 목록/상세 정보 조회 수정 (
#19
)
parent
bef30033
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
services/meetingService.js
+37
-18
37 additions, 18 deletions
services/meetingService.js
with
37 additions
and
18 deletions
services/meetingService.js
+
37
−
18
View file @
d6a423cc
...
@@ -299,21 +299,34 @@ class MeetingService {
...
@@ -299,21 +299,34 @@ class MeetingService {
{
{
model
:
MeetingParticipant
,
model
:
MeetingParticipant
,
as
:
'
participants
'
,
as
:
'
participants
'
,
where
:
{
user_id
:
userId
},
// userId와 매핑된 미팅만 가져옴
required
:
false
,
attributes
:
[],
attributes
:
[],
},
},
{
{
model
:
User
,
model
:
User
,
as
:
'
creator
'
,
as
:
'
creator
'
,
attributes
:
[
'
name
'
],
// 미팅 생성자의 이름만 필요
attributes
:
[
'
name
'
],
}
,
}
]
,
]
});
});
return
meetings
.
map
((
meeting
)
=>
{
return
Promise
.
all
(
meetings
.
map
(
async
(
meeting
)
=>
{
const
isParticipant
=
await
MeetingParticipant
.
findOne
({
where
:
{
meeting_id
:
meeting
.
id
,
user_id
:
userId
}
});
const
hasConflict
=
await
ScheduleService
.
checkScheduleOverlapByTime
(
userId
,
meeting
.
time_idx_start
,
meeting
.
time_idx_end
);
const
creatorName
=
meeting
.
creator
?
meeting
.
creator
.
name
:
'
Unknown
'
;
const
creatorName
=
meeting
.
creator
?
meeting
.
creator
.
name
:
'
Unknown
'
;
return
new
MeetingResponseDTO
(
meeting
,
true
,
false
,
creatorName
);
return
new
MeetingResponseDTO
(
meeting
,
!!
isParticipant
,
hasConflict
,
creatorName
);
});
})
)
;
}
}
...
@@ -451,7 +464,7 @@ class MeetingService {
...
@@ -451,7 +464,7 @@ class MeetingService {
async
getMeetingDetail
(
meetingId
)
{
async
getMeetingDetail
(
meetingId
,
userId
)
{
const
meeting
=
await
Meeting
.
findByPk
(
meetingId
,
{
const
meeting
=
await
Meeting
.
findByPk
(
meetingId
,
{
include
:
[
include
:
[
{
{
...
@@ -465,19 +478,25 @@ class MeetingService {
...
@@ -465,19 +478,25 @@ class MeetingService {
include
:
[
include
:
[
{
{
model
:
User
,
model
:
User
,
as
:
"
user
"
,
// 'participantUser'에서 'user'로 수정
as
:
"
user
"
,
attributes
:
[
"
name
"
,
"
email
"
],
attributes
:
[
"
name
"
,
"
email
"
],
}
,
}
]
,
]
}
,
}
]
,
]
});
});
if
(
!
meeting
)
{
if
(
!
meeting
)
{
throw
new
Error
(
"
모임을 찾을 수 없습니다.
"
);
throw
new
Error
(
"
모임을 찾을 수 없습니다.
"
);
}
}
return
new
MeetingDetailResponseDTO
(
meeting
);
const
hasConflict
=
await
ScheduleService
.
checkScheduleOverlapByTime
(
userId
,
meeting
.
time_idx_start
,
meeting
.
time_idx_end
);
return
new
MeetingDetailResponseDTO
(
meeting
,
hasConflict
);
}
}
/**
/**
...
...
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