Changed HTTP verb to DELETE for DeleteMultipleServiceAccounts (#1526)
This commit is contained in:
@@ -41,12 +41,12 @@ const DeleteMultipleSAs = ({
|
||||
return null;
|
||||
}
|
||||
const onConfirmDelete = () => {
|
||||
invokeDeleteApi(
|
||||
"POST",
|
||||
`/api/v1/service-accounts/delete-multi`,
|
||||
selectedSAs
|
||||
);
|
||||
};
|
||||
invokeDeleteApi(
|
||||
"DELETE",
|
||||
`/api/v1/service-accounts/delete-multi`,
|
||||
selectedSAs
|
||||
);
|
||||
};
|
||||
return (
|
||||
<ConfirmDialog
|
||||
title={`Delete Service Accounts`}
|
||||
|
||||
@@ -3063,7 +3063,7 @@ func init() {
|
||||
}
|
||||
},
|
||||
"/service-accounts/delete-multi": {
|
||||
"post": {
|
||||
"delete": {
|
||||
"tags": [
|
||||
"UserAPI"
|
||||
],
|
||||
@@ -3083,7 +3083,7 @@ func init() {
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"204": {
|
||||
"description": "A successful response."
|
||||
},
|
||||
"default": {
|
||||
@@ -9172,7 +9172,7 @@ func init() {
|
||||
}
|
||||
},
|
||||
"/service-accounts/delete-multi": {
|
||||
"post": {
|
||||
"delete": {
|
||||
"tags": [
|
||||
"UserAPI"
|
||||
],
|
||||
@@ -9192,7 +9192,7 @@ func init() {
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"204": {
|
||||
"description": "A successful response."
|
||||
},
|
||||
"default": {
|
||||
|
||||
@@ -1277,10 +1277,10 @@ func (o *ConsoleAPI) initHandlerCache() {
|
||||
o.handlers["POST"] = make(map[string]http.Handler)
|
||||
}
|
||||
o.handlers["POST"]["/buckets/{bucket_name}/delete-objects"] = user_api.NewDeleteMultipleObjects(o.context, o.UserAPIDeleteMultipleObjectsHandler)
|
||||
if o.handlers["POST"] == nil {
|
||||
o.handlers["POST"] = make(map[string]http.Handler)
|
||||
if o.handlers["DELETE"] == nil {
|
||||
o.handlers["DELETE"] = make(map[string]http.Handler)
|
||||
}
|
||||
o.handlers["POST"]["/service-accounts/delete-multi"] = user_api.NewDeleteMultipleServiceAccounts(o.context, o.UserAPIDeleteMultipleServiceAccountsHandler)
|
||||
o.handlers["DELETE"]["/service-accounts/delete-multi"] = user_api.NewDeleteMultipleServiceAccounts(o.context, o.UserAPIDeleteMultipleServiceAccountsHandler)
|
||||
if o.handlers["DELETE"] == nil {
|
||||
o.handlers["DELETE"] = make(map[string]http.Handler)
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ func NewDeleteMultipleServiceAccounts(ctx *middleware.Context, handler DeleteMul
|
||||
return &DeleteMultipleServiceAccounts{Context: ctx, Handler: handler}
|
||||
}
|
||||
|
||||
/* DeleteMultipleServiceAccounts swagger:route POST /service-accounts/delete-multi UserAPI deleteMultipleServiceAccounts
|
||||
/* DeleteMultipleServiceAccounts swagger:route DELETE /service-accounts/delete-multi UserAPI deleteMultipleServiceAccounts
|
||||
|
||||
Delete Multiple Service Accounts
|
||||
|
||||
|
||||
@@ -30,28 +30,28 @@ import (
|
||||
"github.com/minio/console/models"
|
||||
)
|
||||
|
||||
// DeleteMultipleServiceAccountsOKCode is the HTTP code returned for type DeleteMultipleServiceAccountsOK
|
||||
const DeleteMultipleServiceAccountsOKCode int = 200
|
||||
// DeleteMultipleServiceAccountsNoContentCode is the HTTP code returned for type DeleteMultipleServiceAccountsNoContent
|
||||
const DeleteMultipleServiceAccountsNoContentCode int = 204
|
||||
|
||||
/*DeleteMultipleServiceAccountsOK A successful response.
|
||||
/*DeleteMultipleServiceAccountsNoContent A successful response.
|
||||
|
||||
swagger:response deleteMultipleServiceAccountsOK
|
||||
swagger:response deleteMultipleServiceAccountsNoContent
|
||||
*/
|
||||
type DeleteMultipleServiceAccountsOK struct {
|
||||
type DeleteMultipleServiceAccountsNoContent struct {
|
||||
}
|
||||
|
||||
// NewDeleteMultipleServiceAccountsOK creates DeleteMultipleServiceAccountsOK with default headers values
|
||||
func NewDeleteMultipleServiceAccountsOK() *DeleteMultipleServiceAccountsOK {
|
||||
// NewDeleteMultipleServiceAccountsNoContent creates DeleteMultipleServiceAccountsNoContent with default headers values
|
||||
func NewDeleteMultipleServiceAccountsNoContent() *DeleteMultipleServiceAccountsNoContent {
|
||||
|
||||
return &DeleteMultipleServiceAccountsOK{}
|
||||
return &DeleteMultipleServiceAccountsNoContent{}
|
||||
}
|
||||
|
||||
// WriteResponse to the client
|
||||
func (o *DeleteMultipleServiceAccountsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
||||
func (o *DeleteMultipleServiceAccountsNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
||||
|
||||
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
|
||||
|
||||
rw.WriteHeader(200)
|
||||
rw.WriteHeader(204)
|
||||
}
|
||||
|
||||
/*DeleteMultipleServiceAccountsDefault Generic error response.
|
||||
|
||||
@@ -104,7 +104,7 @@ func registerServiceAccountsHandlers(api *operations.ConsoleAPI) {
|
||||
if err := getDeleteMultipleServiceAccountsResponse(session, params.SelectedSA); err != nil {
|
||||
return user_api.NewDeleteMultipleServiceAccountsDefault(int(err.Code)).WithPayload(err)
|
||||
}
|
||||
return user_api.NewDeleteMultipleServiceAccountsOK()
|
||||
return user_api.NewDeleteMultipleServiceAccountsNoContent()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -1261,7 +1261,7 @@ paths:
|
||||
- UserAPI
|
||||
|
||||
/service-accounts/delete-multi:
|
||||
post:
|
||||
delete:
|
||||
summary: Delete Multiple Service Accounts
|
||||
operationId: DeleteMultipleServiceAccounts
|
||||
parameters:
|
||||
@@ -1273,7 +1273,7 @@ paths:
|
||||
items:
|
||||
type: string
|
||||
responses:
|
||||
200:
|
||||
204:
|
||||
description: A successful response.
|
||||
default:
|
||||
description: Generic error response.
|
||||
|
||||
Reference in New Issue
Block a user