fix: 修改project/add&up接口参数

This commit is contained in:
wenbo.dong 2017-07-20 17:53:28 +08:00
parent 7d3e86bf97
commit 45a3776f28
3 changed files with 8 additions and 6 deletions

View File

@ -37,10 +37,11 @@ const changeTableLoading = (data) => {
};
const addProject = (data) => {
const { name, prd_host, basepath, desc, group_id } = data;
const { name, prd_host, basepath, desc, group_id, protocol } = data;
const param = {
name,
prd_host,
protocol,
basepath,
desc,
group_id
@ -53,10 +54,11 @@ const addProject = (data) => {
};
const updateProject = (data) => {
const { name, prd_host, basepath, desc, _id } = data;
const { name, prd_host, basepath, desc, _id, protocol } = data;
const param = {
name,
prd_host,
protocol,
basepath,
desc,
id: _id

View File

@ -27,7 +27,7 @@ const deleteConfirm = (id, handleDelete, currGroupId, handleFetchList) => {
}
return test;
};
// this.props.fetchProjectList, this.props.changeUpdateModal
const getColumns = (data, props) => {
const { handleDelete, currGroup, fetchProjectList, changeUpdateModal, userInfo } = props;
return [{
@ -130,7 +130,7 @@ class ProjectList extends Component {
});
}
// 确认修改
// 确认添加项目
@autobind
handleOk(e) {
const { form, currGroup, changeTableLoading, addProject, fetchProjectList } = this.props;
@ -138,7 +138,7 @@ class ProjectList extends Component {
e.preventDefault();
form.validateFields((err, values) => {
if (!err) {
values.prd_host = this.state.protocol + values.prd_host;
values.protocol = this.state.protocol.split(':')[0];
// 获取当前分组id传入values
values.group_id = currGroup._id;

View File

@ -86,7 +86,7 @@ class UpDateModal extends Component {
if (!err) {
console.log(projectList[handleUpdateIndex]);
let assignValue = Object.assign(projectList[handleUpdateIndex], values);
assignValue.prd_host = this.state.protocol + assignValue.prd_host;
values.protocol = this.state.protocol.split(':')[0];
assignValue.env = assignValue.envs.map((item) => {
console.log(assignValue);
const arr = assignValue['envs-'+item].split(',');