fake-medium icon indicating copy to clipboard operation
fake-medium copied to clipboard

Actions must be plain objects. Use custom middleware for async actions.

Open nappalm opened this issue 5 years ago • 0 comments

export function newProfile(data) {
    return new Promise((resolve) => (dispatch) => {
        apiAction({
            url: '/profile',
            data,
            onSuccess: ((response) => {
                dispatch({
                    type: NEWPROFILE,
                    payload: response.id
                });
                resolve(response.id);
            }),
            label: LOADING,
        });
  });
}

props.newProfile(data).then((id) => {
    // get id
});

¿How to solved?

nappalm avatar Oct 13 '20 23:10 nappalm