|
|
@@ -660,7 +660,7 @@ class AddGoods extends Component {
|
|
|
newGood: true
|
|
|
}
|
|
|
} else {
|
|
|
- let {name, price, intro, stock, id, status, recommend, unit, img} = props.good
|
|
|
+ let {name, price, intro, stock, id, status, recommend, unit, img, category_id={}} = props.good
|
|
|
this.state = {
|
|
|
...state,
|
|
|
id,
|
|
|
@@ -672,8 +672,8 @@ class AddGoods extends Component {
|
|
|
recommend,
|
|
|
unit,
|
|
|
img,
|
|
|
- category: props.good.category_id.name,
|
|
|
- category_id: [props.good.category_id.id],
|
|
|
+ category: category_id.name,
|
|
|
+ category_id: [category_id.id],
|
|
|
newGood: false
|
|
|
}
|
|
|
}
|