forked from Gitlink/forgeplus-react
FIX bug
This commit is contained in:
parent
81056a2614
commit
a031d9a8cc
|
|
@ -156,13 +156,14 @@ class Detail extends Component {
|
|||
|
||||
componentDidUpdate = (prevState) => {
|
||||
if ((prevState.match.params.projectsId !== this.props.match.params.projectsId)) {
|
||||
this.getProject();
|
||||
this.getDetail();
|
||||
}
|
||||
}
|
||||
|
||||
getProject = () => {
|
||||
const { projectsId } = this.props.match.params;
|
||||
const url = `/repositories/${projectsId}.json`;
|
||||
const url = `/projects/${projectsId}/simple.json`;
|
||||
axios.get(url).then((result) => {
|
||||
this.setState({
|
||||
project: result.data
|
||||
|
|
@ -172,7 +173,7 @@ class Detail extends Component {
|
|||
|
||||
getDetail = () => {
|
||||
const { projectsId } = this.props.match.params;
|
||||
const url = `/repositories/${projectsId}/simple.json`;
|
||||
const url = `/repositories/${projectsId}.json`;
|
||||
axios.get(url).then((result) => {
|
||||
if (result) {
|
||||
this.setState({
|
||||
|
|
@ -285,6 +286,7 @@ class Detail extends Component {
|
|||
axios.post(url).then(result=>{
|
||||
if(result && result.data && result.data.status === 0){
|
||||
this.props.showNotification("镜像同步成功!");
|
||||
this.getProject();
|
||||
this.getDetail();
|
||||
}else{
|
||||
this.props.showNotification("镜像同步失败!");
|
||||
|
|
|
|||
Loading…
Reference in New Issue