feat: add fields to search results

This commit is contained in:
yucheng.chen 2022-03-30 16:17:29 +08:00
parent f8dfbf7eee
commit ae93bd4044

View File

@ -13,8 +13,10 @@ var searchHandler = withUser(func(w http.ResponseWriter, r *http.Request, d *dat
err := search.Search(d.user.Fs, r.URL.Path, query, d, func(path string, f os.FileInfo) error { err := search.Search(d.user.Fs, r.URL.Path, query, d, func(path string, f os.FileInfo) error {
response = append(response, map[string]interface{}{ response = append(response, map[string]interface{}{
"dir": f.IsDir(), "dir": f.IsDir(),
"path": path, "path": path,
"modified": f.ModTime(),
"size": f.Size(),
}) })
return nil return nil