Move setting logic to its own file

It's going to grow
This commit is contained in:
Eli Ribble 2026-02-13 19:20:26 +00:00
parent 38432a18c1
commit 961ca9270e
No known key found for this signature in database
2 changed files with 21 additions and 13 deletions

View file

@ -135,19 +135,6 @@ func getRoot(w http.ResponseWriter, r *http.Request) {
}
}
func getSettings(w http.ResponseWriter, r *http.Request, u *models.User) {
userContent, err := contentForUser(r.Context(), u)
if err != nil {
respondError(w, "Failed to get user content", err, http.StatusInternalServerError)
return
}
data := ContentAuthenticatedPlaceholder{
URL: newContentURL(),
User: userContent,
}
html.RenderOrError(w, "sync/settings.html", data)
}
func getSource(w http.ResponseWriter, r *http.Request, u *models.User) {
globalid_s := chi.URLParam(r, "globalid")
if globalid_s == "" {

21
sync/setting.go Normal file
View file

@ -0,0 +1,21 @@
package sync
import (
"net/http"
"github.com/Gleipnir-Technology/nidus-sync/db/models"
"github.com/Gleipnir-Technology/nidus-sync/html"
)
func getSettings(w http.ResponseWriter, r *http.Request, u *models.User) {
userContent, err := contentForUser(r.Context(), u)
if err != nil {
respondError(w, "Failed to get user content", err, http.StatusInternalServerError)
return
}
data := ContentAuthenticatedPlaceholder{
URL: newContentURL(),
User: userContent,
}
html.RenderOrError(w, "sync/settings.html", data)
}