mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-27 05:30:14 +08:00
fix: import data cat bug
This commit is contained in:
parent
3720980394
commit
427282f88f
@ -72,7 +72,8 @@ class ProjectData extends Component {
|
||||
let menuList = this.state.menuList;
|
||||
let catsObj = {};
|
||||
if(cats && Array.isArray(cats)){
|
||||
cats.forEach(async cat=>{
|
||||
for(let i=0; i< cats.length; i++){
|
||||
let cat = cats[i];
|
||||
let findCat =_.find(menuList, menu=>menu.name === cat.name)
|
||||
catsObj[cat.name] = cat;
|
||||
if(findCat){
|
||||
@ -83,9 +84,9 @@ class ProjectData extends Component {
|
||||
project_id: this.props.match.params.id,
|
||||
desc: cat.desc
|
||||
})
|
||||
cat.id = result._id;
|
||||
cat.id = result.data.data._id;
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
return catsObj;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user