+api doc, fixed endpoints

This commit is contained in:
2023-03-23 17:02:32 +01:00
parent 0ed15a265d
commit 3fb66e075d
4 changed files with 100 additions and 26 deletions

View File

@@ -164,7 +164,7 @@ func HandleResponse(c *cfg.Config, resp *req.Response) error {
func UploadFiles(w io.Writer, c *cfg.Config, args []string) error {
// setup url, req.Request, timeout handling etc
rq := Setup(c, "/file/")
rq := Setup(c, "/uploads/")
// collect files to upload from @argv
if err := GatherFiles(rq, args); err != nil {
@@ -220,7 +220,7 @@ func List(w io.Writer, c *cfg.Config, args []string) error {
func Delete(w io.Writer, c *cfg.Config, args []string) error {
for _, id := range args {
rq := Setup(c, "/file/"+id+"/")
rq := Setup(c, "/uploads/"+id+"/")
resp, err := rq.R.Delete(rq.Url)
@@ -266,7 +266,7 @@ func Download(w io.Writer, c *cfg.Config, args []string) error {
id := args[0]
rq := Setup(c, "/file/"+id+"/")
rq := Setup(c, "/uploads/"+id+"/")
if !c.Silent {
// progres bar