Add export for user admin groups
Add export for user admin groups
- Refactor export resource to use native iterables so we can re-use existing functions that fetch the admin groups and return an array
Part of https://gitlab.com/gitlab-org/gitter/webapp/-/issues/1899
Dev notes
- http://thecodebarbarian.com/async-generator-functions-in-javascript.html
- https://thecodebarbarian.com/cursors-in-mongoose-45
- https://mongoosejs.com/docs/4.x/docs/api.html#cursor-QueryCursor-js
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of
Testing strategy
- Set yourself as a staff user,
mongo gitter
->db.users.update({ username: 'yourusername' }, { staff: true })
- Visit your local Gitter, open the devtools and run
window.troupeContext.user.id
to get your user ID - Replace the user ID in the following URL
- Visit
http://localhost:5000/api_web/export/user/5a87396f1543b98772a686a3/admin-groups.ndjson
and download your messages
Edited by Eric Eastwood