mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
make variable naming more clear
GitOrigin-RevId: fba9406b20d21baaadc2e2fadc9597914396f85a
This commit is contained in:
parent
b335bcb67d
commit
b73319acc1
1 changed files with 11 additions and 7 deletions
|
@ -120,14 +120,18 @@ async function enqueue(group, method, job) {
|
|||
async function getProjectUsersIds(projectId) {
|
||||
// get list of all user ids with access to project. project owner
|
||||
// will always be the first entry in the list.
|
||||
const projectUserIds = await CollaboratorsGetter.getInvitedMemberIds(
|
||||
projectId
|
||||
)
|
||||
// filter list to only return users with dropbox linked
|
||||
// skip the first user id, which is always returned
|
||||
const [
|
||||
ownerUserId,
|
||||
...invitedUserIds
|
||||
] = await CollaboratorsGetter.getInvitedMemberIds(projectId)
|
||||
// if there are no invited users, always return the owner
|
||||
if (!invitedUserIds.length) {
|
||||
return [ownerUserId]
|
||||
}
|
||||
// filter invited users to only return those with dropbox linked
|
||||
const dropboxUsers = await UserGetter.getUsers(
|
||||
{
|
||||
_id: { $in: projectUserIds.slice(1).map(id => ObjectId(id)) },
|
||||
_id: { $in: invitedUserIds.map(id => ObjectId(id)) },
|
||||
'dropbox.access_token.uid': { $ne: null }
|
||||
},
|
||||
{
|
||||
|
@ -135,7 +139,7 @@ async function getProjectUsersIds(projectId) {
|
|||
}
|
||||
)
|
||||
const dropboxUserIds = dropboxUsers.map(user => user._id)
|
||||
return [projectUserIds[0], ...dropboxUserIds]
|
||||
return [ownerUserId, ...dropboxUserIds]
|
||||
}
|
||||
|
||||
async function moveEntity(options) {
|
||||
|
|
Loading…
Reference in a new issue