Skip to content

Commit

Permalink
feat: add conflict to add store (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
CorrectRoadH authored Apr 12, 2024
1 parent 3be6071 commit 55cdc0b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions api/app_management/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ paths:
$ref: "#/components/responses/AppStoreRegisterOK"
"400":
$ref: "#/components/responses/ResponseBadRequest"
"409":
$ref: "#/components/responses/ResponseConflict"
"500":
$ref: "#/components/responses/ResponseInternalServerError"

Expand Down Expand Up @@ -902,6 +904,15 @@ components:
$ref: "#/components/schemas/BaseResponse"
example:
message: "Bad Request"

ResponseConflict:
description: Conflict
content:
application/json:
schema:
$ref: "#/components/schemas/BaseResponse"
example:
message: "Conflict"

ResponseServiceUnavailable:
description: Service Unavailable
Expand Down
2 changes: 1 addition & 1 deletion route/v2/appstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (a *AppManagement) RegisterAppStore(ctx echo.Context, params codegen.Regist

if isExist {
message := "appstore is already registered"
return ctx.JSON(http.StatusOK, codegen.AppStoreRegisterOK{Message: &message})
return ctx.JSON(http.StatusConflict, codegen.ResponseConflict{Message: &message})
}

backgroundCtx := common.WithProperties(context.Background(), PropertiesFromQueryParams(ctx))
Expand Down

0 comments on commit 55cdc0b

Please sign in to comment.