[英]Issue with passing data for registration in redux-saga
我在redux-saga工作流程中遇到一个注册单个用户的问题。 这是redux-saga的代码的一部分:
// Relative imports
import * as ActionTypes from "./constants";
import { signupAPI } from "../../../utils/webAPI";
function* signup(action) {
try {
yield call(signupAPI, action.data);
yield put({ type: ActionTypes.USER_SIGNUP_SUCCESS });
} catch (error) {
yield put({ type: ActionTypes.USER_SIGNUP_ERROR, error });
}
}
export default [takeLatest(ActionTypes.USER_SIGNUP_REQUESTING, signup)];
这是对服务器的API调用:
// POST request to create user with email, password, firstName, lastName
export const signupAPI = data => http.post(`${API}/users`, data);
我正在使用axios,“ http”是axios的配置。 我想做的是:在signupAPI中传递电子邮件,密码,名称,姓氏数据。 我得到的是: 错误图像我不确定做错了什么。
减速器文件中发现未使用的变量时出错。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.