fix: 处理项目列表接口请求参数错误的bug

This commit is contained in:
wenbo.dong 2017-07-20 14:57:19 +08:00
parent c6a866975c
commit c2bb1e2a06
2 changed files with 4 additions and 3 deletions

View File

@ -53,13 +53,13 @@ const addProject = (data) => {
}; };
const updateProject = (data) => { const updateProject = (data) => {
const { name, prd_host, basepath, desc, group_id } = data; const { name, prd_host, basepath, desc, _id } = data;
const param = { const param = {
name, name,
prd_host, prd_host,
basepath, basepath,
desc, desc,
group_id id: _id
}; };
return { return {
type: PROJECT_UPDATE, type: PROJECT_UPDATE,

View File

@ -78,12 +78,13 @@ class UpDateModal extends Component {
this.props.changeUpdateModal(false, -1); this.props.changeUpdateModal(false, -1);
} }
// 确认修改
handleOk = (e) => { handleOk = (e) => {
e.preventDefault(); e.preventDefault();
const { form, updateProject, changeUpdateModal, currGroup, projectList, handleUpdateIndex, fetchProjectList, changeTableLoading } = this.props; const { form, updateProject, changeUpdateModal, currGroup, projectList, handleUpdateIndex, fetchProjectList, changeTableLoading } = this.props;
form.validateFields((err, values) => { form.validateFields((err, values) => {
if (!err) { if (!err) {
console.log(values); console.log(projectList[handleUpdateIndex]);
let assignValue = Object.assign(projectList[handleUpdateIndex], values); let assignValue = Object.assign(projectList[handleUpdateIndex], values);
assignValue.prd_host = this.state.protocol + assignValue.prd_host; assignValue.prd_host = this.state.protocol + assignValue.prd_host;
assignValue.env = assignValue.envs.map((item) => { assignValue.env = assignValue.envs.map((item) => {