Skip to content

Commit

Permalink
minor fix: update app name
Browse files Browse the repository at this point in the history
  • Loading branch information
lyricat committed Apr 18, 2023
1 parent 55c0e82 commit 21b8cde
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions handler/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func UpdateApp(appz core.AppService) http.HandlerFunc {

// validate uuid
if _, err := uuid.Parse(appID); err != nil {
render.Error(w, http.StatusBadRequest, core.ErrAppNotFound)
render.Error(w, http.StatusNotFound, core.ErrAppNotFound)
return
}

Expand All @@ -135,11 +135,13 @@ func UpdateApp(appz core.AppService) http.HandlerFunc {
return
}

if err := appz.UpdateApp(ctx, user.ID, body.Name); err != nil {
if err := appz.UpdateApp(ctx, app.ID, body.Name); err != nil {
render.Error(w, http.StatusInternalServerError, err)
return
}

app.Name = body.Name

render.JSON(w, app)
}
}
Expand Down

0 comments on commit 21b8cde

Please sign in to comment.