[英]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.