Created
July 5, 2019 16:49
-
-
Save nomoney4me/35b9db0b26feacd4103b795e0111e2d7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gservices = { | |
fetchUsers: (nextPageToken, result) => { | |
return Promise.try(() => { | |
return admin.users.list({ | |
domain: '', | |
maxResults: 40, | |
pageToken: nextPageToken || '', | |
}) | |
}).then(resp => { | |
result = [...result || [], ...resp.data.users] | |
if (resp.data.nextPageToken) gservices.fetchUsers(resp.data.nextPageToken, result) | |
else return result | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment