Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot use epic with a . as payload #1

Open
justintim-es opened this issue Mar 13, 2021 · 0 comments
Open

cannot use epic with a . as payload #1

justintim-es opened this issue Mar 13, 2021 · 0 comments

Comments

@justintim-es
Copy link

justintim-es commented Mar 13, 2021

if i use the epic to map to another action all of a sudden it throws the following error if the payload contains:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2MDRhMjc5ODNiN2JkMDBjZDA0NmRjYjgiLCJpYXQiOjE2MTU2NjQ3MDd9.BjiO_QZ-LqdIjvnlso4oA_LLsvkPiH66oyVVQIz0hbc
here's my epic but first it worked without any problem but all of a sudden it doesn't accept an epic with a token nomore

export const loginEpicFetch = (action: Observable<IAction<any>>): Observable<IAction<any>> => {
  return action.pipe(filter(ac => ac.type === RDX_LOGIN_FETCH),
  switchMap(ac => instance.post('/api/accounts/login', ac.payload).then(res => {
    const token = res.headers['x-auth-token'];
    console.log(token);
    return {
      type: RDX_LOGIN_FETCH_SUCCESS,
      component: ac.component,
      payload: {
        token: token,
        address: res.data
      }
    }
  }).catch((err: AxiosError) => {
    return {
      type: RDX_LOGIN_FETCH_ERROR,
      component: ac.component,
      payload: err.response.data
    }
  })));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant