export const showTaskDetails = (taskId) => {
return (dispatch) => {
if (!taskId) {
dispatch({
type: ActionTypes.SHOW_TASK_DETAILS,
data: null
});
} else {
dispatch({type: ActionTypes.START_TASK_DETAILS_LOADING});
RequestsAndTasksApi.getTaskById(taskId).then(task => {
dispatch({
type: ActionTypes.SHOW_TASK_DETAILS,
data: task
});
}).catch(error => {
throw(error);
});
}
};
};
我需要使用RequestsAndTasksApi.getProtocolIdByTaskId(taskId)创建链接,如何在actionCreator(redux)中使用此请求并保存在此数据中?