Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
bzp2010 committed Aug 27, 2021
1 parent 1f5f285 commit 781fa52
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions api/internal/handler/proto/proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,20 @@ func (h *Handler) Create(c droplet.Context) (interface{}, error) {

// check proto id exist
ret, err := h.protoStore.Get(c.Context(), input.ID.(string))
if err != nil {
return handler.SpecCodeResponse(err), err
}
if ret != nil {
return &data.SpecCodeResponse{StatusCode: http.StatusBadRequest}, errors.New("proto id exists")
}

// create
res, err := h.protoStore.Create(c.Context(), input)
ret, err = h.protoStore.Create(c.Context(), input)
if err != nil {
return handler.SpecCodeResponse(err), err
}

return res, nil
return ret, nil
}

type UpdateInput struct {
Expand Down

0 comments on commit 781fa52

Please sign in to comment.