Fix Syndicate paths.

This commit is contained in:
2025-04-04 10:57:06 +01:00
parent 22fbf59157
commit 02300c69d8
10 changed files with 65 additions and 27 deletions

View File

@@ -23,7 +23,7 @@ func SyndicateInviteHandler(db *sql.DB) http.HandlerFunc {
context := helpers.TemplateContext(w, r, data)
context["SyndicateID"] = syndicateID
tmpl := helpers.LoadTemplateFiles("invite-syndicate.html", "templates/syndicates/invite.html")
tmpl := helpers.LoadTemplateFiles("invite-syndicate.html", "templates/syndicate/invite.html")
err := tmpl.ExecuteTemplate(w, "layout", context)
if err != nil {
helpers.RenderError(w, r, 500)
@@ -38,7 +38,7 @@ func SyndicateInviteHandler(db *sql.DB) http.HandlerFunc {
} else {
helpers.SetFlash(w, r, "Invite sent successfully.")
}
http.Redirect(w, r, "/account/syndicates/view?id="+strconv.Itoa(syndicateID), http.StatusSeeOther)
http.Redirect(w, r, "/syndicate/view?id="+strconv.Itoa(syndicateID), http.StatusSeeOther)
default:
helpers.RenderError(w, r, http.StatusMethodNotAllowed)
@@ -59,7 +59,7 @@ func ViewInvitesHandler(db *sql.DB) http.HandlerFunc {
context := helpers.TemplateContext(w, r, data)
context["Invites"] = invites
tmpl := helpers.LoadTemplateFiles("invites.html", "templates/syndicates/invites.html")
tmpl := helpers.LoadTemplateFiles("invites.html", "templates/syndicate/invites.html")
tmpl.ExecuteTemplate(w, "layout", context)
}
}
@@ -78,7 +78,7 @@ func AcceptInviteHandler(db *sql.DB) http.HandlerFunc {
} else {
helpers.SetFlash(w, r, "You have joined the syndicate")
}
http.Redirect(w, r, "/account/syndicates", http.StatusSeeOther)
http.Redirect(w, r, "/syndicates", http.StatusSeeOther)
}
}
@@ -86,6 +86,6 @@ func DeclineInviteHandler(db *sql.DB) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
inviteID := helpers.Atoi(r.URL.Query().Get("id"))
_ = storage.UpdateInviteStatus(db, inviteID, "declined")
http.Redirect(w, r, "/account/syndicates/invites", http.StatusSeeOther)
http.Redirect(w, r, "/syndicate/invites", http.StatusSeeOther)
}
}