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
67c2a54b
Commit
67c2a54b
authored
3 months ago
by
조대희
Browse files
Options
Downloads
Patches
Plain Diff
bugfix: 미팅 조회 코드 수정
parent
e6169bf9
No related branches found
Branches containing commit
No related tags found
1 merge request
!42
[#25] 배포코드 master브랜치로 이동
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
services/meetingService.js
+26
-54
26 additions, 54 deletions
services/meetingService.js
with
26 additions
and
54 deletions
services/meetingService.js
+
26
−
54
View file @
67c2a54b
...
@@ -322,16 +322,9 @@ class MeetingService {
...
@@ -322,16 +322,9 @@ class MeetingService {
'
time_idx_start
'
,
'
time_idx_end
'
,
'
time_idx_start
'
,
'
time_idx_end
'
,
'
location
'
,
'
time_idx_deadline
'
,
'
location
'
,
'
time_idx_deadline
'
,
'
type
'
,
'
max_num
'
,
'
cur_num
'
,
'
type
'
,
'
max_num
'
,
'
cur_num
'
,
'
created_at
'
'
created_at
'
],
],
include
:
[
include
:
[
{
model
:
MeetingParticipant
,
as
:
'
participants
'
,
required
:
false
,
where
:
{
user_id
:
userId
},
attributes
:
[]
},
{
{
model
:
User
,
model
:
User
,
as
:
'
creator
'
,
as
:
'
creator
'
,
...
@@ -339,14 +332,6 @@ class MeetingService {
...
@@ -339,14 +332,6 @@ class MeetingService {
required
:
false
required
:
false
}
}
],
],
where
:
{
[
Op
.
or
]:
[
{
created_by
:
userId
},
{
'
$participants.meeting_id$
'
:
{
[
Op
.
col
]:
'
Meeting.id
'
}
},
{
'
$participants.user_id$
'
:
userId
}
]
},
subQuery
:
false
,
order
:
[[
'
created_at
'
,
'
DESC
'
]],
order
:
[[
'
created_at
'
,
'
DESC
'
]],
limit
:
limit
+
1
,
limit
:
limit
+
1
,
offset
,
offset
,
...
@@ -356,7 +341,13 @@ class MeetingService {
...
@@ -356,7 +341,13 @@ class MeetingService {
const
hasNext
=
meetings
.
length
>
limit
;
const
hasNext
=
meetings
.
length
>
limit
;
const
content
=
await
Promise
.
all
(
const
content
=
await
Promise
.
all
(
meetings
.
slice
(
0
,
limit
).
map
(
async
(
meeting
)
=>
{
meetings
.
slice
(
0
,
limit
).
map
(
async
(
meeting
)
=>
{
const
isParticipant
=
true
;
const
isParticipant
=
await
MeetingParticipant
.
findOne
({
where
:
{
meeting_id
:
meeting
.
id
,
user_id
:
userId
}
});
const
hasConflict
=
await
ScheduleService
.
checkScheduleOverlapByTime
(
const
hasConflict
=
await
ScheduleService
.
checkScheduleOverlapByTime
(
userId
,
userId
,
meeting
.
time_idx_start
,
meeting
.
time_idx_start
,
...
@@ -365,7 +356,7 @@ class MeetingService {
...
@@ -365,7 +356,7 @@ class MeetingService {
return
new
MeetingResponseDTO
(
return
new
MeetingResponseDTO
(
meeting
,
meeting
,
isParticipant
,
!!
isParticipant
,
hasConflict
,
hasConflict
,
meeting
.
creator
?.
name
||
'
Unknown
'
meeting
.
creator
?.
name
||
'
Unknown
'
);
);
...
@@ -385,31 +376,26 @@ class MeetingService {
...
@@ -385,31 +376,26 @@ class MeetingService {
try
{
try
{
const
meetings
=
await
Meeting
.
findAll
({
const
meetings
=
await
Meeting
.
findAll
({
attributes
:
[
attributes
:
[
'
id
'
,
'
title
'
,
'
description
'
,
'
time_idx_start
'
,
'
id
'
,
'
title
'
,
'
description
'
,
'
time_idx_end
'
,
'
location
'
,
'
time_idx_deadline
'
,
'
time_idx_start
'
,
'
time_idx_end
'
,
'
location
'
,
'
time_idx_deadline
'
,
'
type
'
,
'
max_num
'
,
'
cur_num
'
,
'
type
'
,
'
max_num
'
,
'
cur_num
'
,
'
created_at
'
],
],
include
:
[
include
:
[
{
{
model
:
MeetingParticipant
,
model
:
MeetingParticipant
,
as
:
'
participants
'
,
as
:
'
participants
'
,
required
:
false
,
where
:
{
user_id
:
userId
}
,
attributes
:
[]
required
:
true
},
},
{
{
model
:
User
,
model
:
User
,
as
:
'
creator
'
,
as
:
'
creator
'
,
attributes
:
[
'
name
'
]
attributes
:
[
'
name
'
],
required
:
false
}
}
],
],
where
:
{
[
Op
.
or
]:
[
{
created_by
:
userId
},
{
'
$participants.meeting_id$
'
:
{
[
Op
.
col
]:
'
Meeting.id
'
}
},
{
'
$participants.user_id$
'
:
userId
}
]
},
subQuery
:
false
,
order
:
[[
'
created_at
'
,
'
DESC
'
]],
order
:
[[
'
created_at
'
,
'
DESC
'
]],
limit
:
limit
+
1
,
limit
:
limit
+
1
,
offset
,
offset
,
...
@@ -417,29 +403,14 @@ class MeetingService {
...
@@ -417,29 +403,14 @@ class MeetingService {
});
});
const
hasNext
=
meetings
.
length
>
limit
;
const
hasNext
=
meetings
.
length
>
limit
;
const
content
=
await
Promise
.
all
(
const
content
=
meetings
.
slice
(
0
,
limit
).
map
(
meeting
=>
{
meetings
.
slice
(
0
,
limit
).
map
(
async
(
meeting
)
=>
{
return
new
MeetingResponseDTO
(
const
isParticipant
=
await
MeetingParticipant
.
findOne
({
meeting
,
where
:
{
true
,
// 참여자로 조회했으므로 항상 true
meeting_id
:
meeting
.
id
,
false
,
// 이미 참여 중인 미팅이므로 충돌 체크 불필요
user_id
:
userId
meeting
.
creator
?.
name
||
'
Unknown
'
}
);
});
});
const
hasConflict
=
await
ScheduleService
.
checkScheduleOverlapByTime
(
userId
,
meeting
.
time_idx_start
,
meeting
.
time_idx_end
);
return
{
...
meeting
.
toJSON
(),
isParticipant
:
!!
isParticipant
,
hasConflict
,
creatorName
:
meeting
.
creator
?.
name
||
'
Unknown
'
};
})
);
return
{
content
,
hasNext
};
return
{
content
,
hasNext
};
}
catch
(
error
)
{
}
catch
(
error
)
{
...
@@ -447,6 +418,7 @@ class MeetingService {
...
@@ -447,6 +418,7 @@ class MeetingService {
throw
new
Error
(
'
Failed to fetch my meetings
'
);
throw
new
Error
(
'
Failed to fetch my meetings
'
);
}
}
}
}
async
getMeetingDetail
(
meetingId
,
userId
)
{
async
getMeetingDetail
(
meetingId
,
userId
)
{
const
meeting
=
await
Meeting
.
findByPk
(
meetingId
,
{
const
meeting
=
await
Meeting
.
findByPk
(
meetingId
,
{
include
:
[
include
:
[
...
...
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