diff --git a/app/handler/file.go b/app/handler/file.go index 2fd52cb..1bec50a 100644 --- a/app/handler/file.go +++ b/app/handler/file.go @@ -239,10 +239,10 @@ func (hand *Handler) DeleteCollection(rctx *router.Context) { params := &operator.DeleteColletionParams{ Path: cpath, } - err := rctx.BindQuery(params) + err := rctx.BindQuery(params) if err != nil { - hand.logg.Errorf("DeleteColletion binding error: %v", err) - rctx.SetStatus(http.StatusInternalServerError) + hand.logg.Errorf("DeleteColletion binding error: %v", err) + rctx.SetStatus(http.StatusInternalServerError) return } diff --git a/app/operator/file.go b/app/operator/file.go index 1944691..8e86acb 100644 --- a/app/operator/file.go +++ b/app/operator/file.go @@ -358,8 +358,8 @@ func (oper *Operator) ListCollections(ctx context.Context, operID string, param // DeleteColletion type DeleteColletionParams struct { - Path string - IsPattern bool `params:"isPattern"` + Path string + IsPattern bool `params:"isPattern"` } type DeleteColletionResult struct { Files []descr.File `json:"collection,omitempty"` diff --git a/cmd/mstorectl/filecmd.go b/cmd/mstorectl/filecmd.go index 45cb89c..5db8d42 100644 --- a/cmd/mstorectl/filecmd.go +++ b/cmd/mstorectl/filecmd.go @@ -428,9 +428,9 @@ func (util *FileUtil) listCollections(common *CommonFileParams, params *ListColl // DeleteCollection type DeleteCollectionParams struct { - Path string - Detail bool - Recursive bool + Path string + Detail bool + Recursive bool } type DeleteCollectionResult struct { diff --git a/pkg/client/file.go b/pkg/client/file.go index 6ff5bdc..9c040af 100644 --- a/pkg/client/file.go +++ b/pkg/client/file.go @@ -16,10 +16,10 @@ import ( "fmt" "io" "net/http" + "net/url" "os" "path/filepath" "strconv" - "net/url" "mstore/app/descr" "mstore/pkg/auxhttp" @@ -336,13 +336,11 @@ func (cli *Client) DeleteCollection(ctx context.Context, catalogURI string, isPa if err != nil { return res, err } - if isPattern { - values := url.Values{} - values.Add("isPattern","true") - catalogURI = catalogURI + "?" + values.Encode() - } - - + if isPattern { + values := url.Values{} + values.Add("isPattern", "true") + catalogURI = catalogURI + "?" + values.Encode() + } req, err := http.NewRequestWithContext(ctx, http.MethodDelete, catalogURI, nil) if err != nil {