action-chats.js 918 B

1234567891011121314151617181920212223242526272829
  1. import actionPromise from "./action-promise";
  2. import {gql} from '../../graphQl/getGQL'
  3. import jwtDecode from '../../helpers/jwt-decode'
  4. /* export const actionAboutMe = () => {
  5. let _id = jwtDecode(localStorage.authToken).sub.id
  6. return (
  7. actionPromise('userData', gql(`
  8. query($userId: String!) {
  9. UserFindOne(query: $userId){
  10. login, _id, avatar {_id, url, originalFileName}
  11. }
  12. }
  13. `, { userId: JSON.stringify([{ _id }]) }))
  14. )
  15. } */
  16. /* export const actionChats = () => {
  17. let _id = jwtDecode(localStorage.authToken).sub.id
  18. return (
  19. actionPromise('chats', gql(`
  20. query($userId: String!) {
  21. UserFindOne(query: $userId){
  22. login, _id, avatar {_id, url, originalFileName}
  23. }
  24. }
  25. `, { userId: JSON.stringify([{ _id }]) }))
  26. )
  27. } */