working commit
This commit is contained in:
+3
-3
@@ -239,10 +239,10 @@ func (hand *Handler) DeleteCollection(rctx *router.Context) {
|
|||||||
params := &operator.DeleteColletionParams{
|
params := &operator.DeleteColletionParams{
|
||||||
Path: cpath,
|
Path: cpath,
|
||||||
}
|
}
|
||||||
err := rctx.BindQuery(params)
|
err := rctx.BindQuery(params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
hand.logg.Errorf("DeleteColletion binding error: %v", err)
|
hand.logg.Errorf("DeleteColletion binding error: %v", err)
|
||||||
rctx.SetStatus(http.StatusInternalServerError)
|
rctx.SetStatus(http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -358,8 +358,8 @@ func (oper *Operator) ListCollections(ctx context.Context, operID string, param
|
|||||||
|
|
||||||
// DeleteColletion
|
// DeleteColletion
|
||||||
type DeleteColletionParams struct {
|
type DeleteColletionParams struct {
|
||||||
Path string
|
Path string
|
||||||
IsPattern bool `params:"isPattern"`
|
IsPattern bool `params:"isPattern"`
|
||||||
}
|
}
|
||||||
type DeleteColletionResult struct {
|
type DeleteColletionResult struct {
|
||||||
Files []descr.File `json:"collection,omitempty"`
|
Files []descr.File `json:"collection,omitempty"`
|
||||||
|
|||||||
@@ -428,9 +428,9 @@ func (util *FileUtil) listCollections(common *CommonFileParams, params *ListColl
|
|||||||
|
|
||||||
// DeleteCollection
|
// DeleteCollection
|
||||||
type DeleteCollectionParams struct {
|
type DeleteCollectionParams struct {
|
||||||
Path string
|
Path string
|
||||||
Detail bool
|
Detail bool
|
||||||
Recursive bool
|
Recursive bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteCollectionResult struct {
|
type DeleteCollectionResult struct {
|
||||||
|
|||||||
+6
-8
@@ -16,10 +16,10 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
"net/url"
|
|
||||||
|
|
||||||
"mstore/app/descr"
|
"mstore/app/descr"
|
||||||
"mstore/pkg/auxhttp"
|
"mstore/pkg/auxhttp"
|
||||||
@@ -336,13 +336,11 @@ func (cli *Client) DeleteCollection(ctx context.Context, catalogURI string, isPa
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return res, err
|
return res, err
|
||||||
}
|
}
|
||||||
if isPattern {
|
if isPattern {
|
||||||
values := url.Values{}
|
values := url.Values{}
|
||||||
values.Add("isPattern","true")
|
values.Add("isPattern", "true")
|
||||||
catalogURI = catalogURI + "?" + values.Encode()
|
catalogURI = catalogURI + "?" + values.Encode()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
req, err := http.NewRequestWithContext(ctx, http.MethodDelete, catalogURI, nil)
|
req, err := http.NewRequestWithContext(ctx, http.MethodDelete, catalogURI, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user