Add /folders API to get directory lists for browsing #260

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer
2020-05-22 16:29:12 +02:00
parent 9b01cb864d
commit a7122ff4e1
38 changed files with 634 additions and 129 deletions

View File

@@ -1,21 +1,12 @@
package api
import (
"github.com/stretchr/testify/assert"
"github.com/tidwall/gjson"
"net/http"
"testing"
)
func TestGetImportOptions(t *testing.T) {
t.Run("successful request", func(t *testing.T) {
app, router, conf := NewApiTest()
GetImportOptions(router, conf)
r := PerformRequest(app, "GET", "/api/v1/import")
assert.True(t, gjson.Get(r.Body.String(), "dirs").IsArray())
assert.Equal(t, http.StatusOK, r.Code)
})
}
"github.com/stretchr/testify/assert"
"github.com/tidwall/gjson"
)
func TestCancelImport(t *testing.T) {
t.Run("successful request", func(t *testing.T) {