overrite stack name for update (#5743)

pull/5884/head
Marcelo Rydel 3 years ago committed by GitHub
parent 109b27594a
commit 1ee363f8c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -143,12 +143,14 @@ func (handler *Handler) stackMigrate(w http.ResponseWriter, r *http.Request) *ht
return migrationError
}
newName := stack.Name
stack.Name = oldName
err = handler.deleteStack(securityContext.UserID, stack, endpoint)
if err != nil {
return &httperror.HandlerError{StatusCode: http.StatusInternalServerError, Message: err.Error(), Err: err}
}
stack.Name = newName
err = handler.DataStore.Stack().UpdateStack(stack.ID, stack)
if err != nil {
return &httperror.HandlerError{StatusCode: http.StatusInternalServerError, Message: "Unable to persist the stack changes inside the database", Err: err}

Loading…
Cancel
Save