- keep store.id when CreateStore.

This commit is contained in:
gazebo
2018-09-25 11:35:50 +08:00
parent 604f232e60
commit 543e469eeb
2 changed files with 3 additions and 1 deletions

View File

@@ -211,7 +211,9 @@ func UpdateStore(storeID int, payload map[string]interface{}, userName string) (
}
func CreateStore(store *model.Store, userName string) (id int, err error) {
existingID := store.ID
dao.WrapAddIDCULDEntity(store, userName)
store.ID = existingID
if err = dao.CreateEntity(nil, store); err == nil {
return store.ID, err
}