diff --git a/collections/collections.go b/collections/collections.go index 0d128964..eb77c0cf 100644 --- a/collections/collections.go +++ b/collections/collections.go @@ -155,12 +155,13 @@ func GetDirectoryContents(refs []util.ContentWithPath, queryDir, coluuid string) if directoryContent != nil { // if there was content if directoryContent.Type == CidTypeDir { // if the content was a directory - subDir := directoryContent.Dir + subDir := filepath.Join(directoryContent.Dir, directoryContent.Name) if dirs[subDir] { // if the directory had already been added to response, continue continue } dirs[subDir] = true } + result = append(result, directoryContent) } } diff --git a/util/misc.go b/util/misc.go index 8a2cce77..e1af71b1 100644 --- a/util/misc.go +++ b/util/misc.go @@ -108,7 +108,7 @@ func NewBinder(log *zap.SugaredLogger) binder { func (b binder) Bind(i interface{}, c echo.Context) error { defer func() { if err := c.Request().Body.Close(); err != nil { - b.log.Warnf("failed to close request body: %s", err) + log.Warnf("failed to close request body: %s", err) } }()