feat: add file visibility toggle for files

This commit is contained in:
2024-09-15 23:59:19 +07:00
parent dc330cc72f
commit b246d85fac
22 changed files with 738 additions and 144 deletions

View File

@ -25,13 +25,14 @@ func GET(w http.ResponseWriter, r *http.Request) {
ID: files[i].ID.String(),
Name: files[i].Name,
Size: utils.ConvertFileSize(files[i].Size),
IsPrivate: files[i].IsPrivate,
Downloaded: strconv.FormatUint(files[i].Downloaded, 10),
})
}
var component templ.Component
if r.Header.Get("hx-request") == "true" {
component = fileView.MainContent(filesData)
component = fileView.MainContent(filesData, userSession)
} else {
component = fileView.Main("File Dashboard", filesData, userSession)
}