许可证-issue
This commit is contained in:
parent
2997ff8517
commit
bd736ef09f
|
|
@ -683,7 +683,7 @@ function CoderDepot(props){
|
|||
projectDetail.license_name ?
|
||||
<Link to={`/${owner}/${projectsId}/tree/${turnbar(branchName || defaultBranch)}/LICENSE`} className="color-grey-6">{projectDetail.license_name}</Link>
|
||||
:
|
||||
<span>暂无数据,点击<a className='color-blue' onClick={()=>{setLicenseVisible(true)}}>选择并创建许可证</a></span>
|
||||
<a className='color-blue' onClick={()=>{setLicenseVisible(true)}}>点击选择许可证(LICENSE)</a>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -162,9 +162,9 @@ class CoderRootFileDetail extends Component {
|
|||
};
|
||||
|
||||
deleteFile = () => {
|
||||
const { detail } = this.props;
|
||||
const { detail ,projectDetail , getDetail } = this.props;
|
||||
const { projectsId, owner ,branchName} = this.props.match.params;
|
||||
|
||||
console.log(detail,this.props);
|
||||
const url = `/${owner}/${projectsId}/delete_file.json`;
|
||||
axios.delete(url, {
|
||||
params: {
|
||||
|
|
@ -176,8 +176,18 @@ class CoderRootFileDetail extends Component {
|
|||
})
|
||||
.then((result) => {
|
||||
if (result) {
|
||||
this.props.showNotification("删除成功!");
|
||||
this.props.history.push(`/${owner}/${projectsId}`);
|
||||
if(detail.path && detail.path==="LICENSE" && projectDetail){
|
||||
const url1 = `/${owner}/${projectsId}.json`;
|
||||
const { name , identifier } = projectDetail;
|
||||
axios.put(url1,{name,identifier,license_id:""}).then(res=>{
|
||||
getDetail && getDetail();
|
||||
this.props.showNotification("删除成功!");
|
||||
this.props.history.push(`/${owner}/${projectsId}`);
|
||||
}).catch(error=>{})
|
||||
}else{
|
||||
this.props.showNotification("删除成功!");
|
||||
this.props.history.push(`/${owner}/${projectsId}`);
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue