From b73aa84ddc513668b8528dd126a083659344449e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 10 Feb 2020 14:30:40 -0500 Subject: [PATCH] fix: tests --- src/groups/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/groups/index.js b/src/groups/index.js index bf2a93cf97..231b876c1c 100644 --- a/src/groups/index.js +++ b/src/groups/index.js @@ -156,7 +156,7 @@ Groups.getOwnersAndMembers = async function (groupName, uid, start, stop) { let done = false; let returnUsers = owners; - let memberStart = start - ownerUids.length + 1; + let memberStart = start - ownerUids.length; let memberStop = memberStart + countToReturn - 1; memberStart = Math.max(0, memberStart); memberStop = Math.max(0, memberStop); @@ -175,8 +175,8 @@ Groups.getOwnersAndMembers = async function (groupName, uid, start, stop) { while (returnUsers.length < countToReturn && !done) { /* eslint-disable no-await-in-loop */ await addMembers(memberStart, memberStop); - memberStart += countToReturn; - memberStop += countToReturn; + memberStart = memberStop + 1; + memberStop = memberStart + countToReturn - 1; } }