forked from Gitlink/forgeplus-react
新建合并请求:切换目标分支或者源分支时不用调用check_can_merge接口
This commit is contained in:
parent
dea3b71539
commit
0a7e1bf1a3
|
@ -105,6 +105,18 @@ class NewMerge extends Component {
|
|||
}
|
||||
axios.get(url).then(result=>{
|
||||
if(result){
|
||||
if (result.data.status === 0) {
|
||||
this.setState({
|
||||
isSpin: false,
|
||||
show_message: false,
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
isSpin: false,
|
||||
show_message: true,
|
||||
default_message: result.data.message,
|
||||
});
|
||||
}
|
||||
this.setState({
|
||||
comparesData:result.data
|
||||
})
|
||||
|
@ -143,7 +155,7 @@ class NewMerge extends Component {
|
|||
merge:"master"
|
||||
})
|
||||
}
|
||||
this.ischeckmerge();
|
||||
// this.ischeckmerge();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -169,7 +181,7 @@ class NewMerge extends Component {
|
|||
selectBrach = (type, value) => {
|
||||
const { projectsId , owner } = this.props.match.params;
|
||||
this.state[type] = value;
|
||||
this.ischeckmerge();
|
||||
// this.ischeckmerge();
|
||||
let { id ,merge , pull } = this.state;
|
||||
if(type==="pull"){
|
||||
this.props.history.push(`/projects/${owner}/${projectsId}/pulls/new/${pull}`)
|
||||
|
@ -199,7 +211,6 @@ class NewMerge extends Component {
|
|||
};
|
||||
|
||||
//判断2分支是否可以合并
|
||||
|
||||
ischeckmerge = () => {
|
||||
this.setState({ isSpin: true });
|
||||
const { projectsId , owner } = this.props.match.params;
|
||||
|
|
Loading…
Reference in New Issue