Advertisement
Guest User

Untitled

a guest
Feb 24th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. const container = compose(
  2. graphql(LOGIN_MUTATION, {
  3. props: ({ mutate, ownProps }) => ({
  4. login: input =>
  5. mutate({
  6. variables: {
  7. input,
  8. },
  9. })
  10. .then(data => {
  11. console.log('data', data);
  12. if (data.loginResponse) {
  13. ownProps.history.push('/repositories');
  14. } else {
  15. return '!!!!!!!!!!';
  16. }
  17. })
  18. .catch(mapRej(selectErrors)),
  19. }),
  20. }),
  21. withForm({
  22. handleSubmit: (values, { props, setSubmitting, setStatus }) => {
  23. props.login(values);
  24. },
  25. mapPropsToValues: props => ({
  26. username: props.username,
  27. password: props.password,
  28. }),
  29. })
  30. );
  31.  
  32. type Props = {
  33. handleSubmit: Function,
  34. };
  35.  
  36. const LoginScene = (props: Props) => (
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement