actionUsersAll.js 846 B

123456789101112131415161718192021222324252627
  1. import { actionPromise } from "../reducers";
  2. import { gql } from "../helpers";
  3. export const actionUsersAll = ({ limit = 0, skip = 0, promiseName = "adminUsersAll", orderBy = "_id" } = {}) =>
  4. actionPromise(
  5. promiseName,
  6. gql(
  7. `query UsersAll($query:String){
  8. UserFind(query: $query){
  9. _id username is_active acl
  10. avatar{
  11. _id url
  12. }
  13. }
  14. }`,
  15. {
  16. query: JSON.stringify([
  17. {},
  18. {
  19. limit: !!limit ? limit : 100,
  20. skip: skip,
  21. orderBy,
  22. },
  23. ]),
  24. }
  25. )
  26. );