actionUserById.js 524 B

12345678910111213141516171819
  1. import { gql } from "../helpers";
  2. import { actionPromise } from "../reducers";
  3. export const actionUserById = ({ _id, promiseName = "adminUserById" }) =>
  4. actionPromise(
  5. promiseName,
  6. gql(
  7. `query UsersById($q:String){
  8. UserFindOne(query: $q){
  9. _id username is_active acl name nick
  10. avatar{
  11. _id url
  12. }
  13. }
  14. }`,
  15. { q: JSON.stringify([{ _id }]) }
  16. )
  17. );