fix: register forum/thread routes at top level + notification dots in ServerBar

Moved thread and forum-tag routes from nested /servers/{sid}/channels/ to
top-level /channels/{id}/... to match frontend API calls. Forum posts were
getting SPA HTML fallback instead of JSON.

Added orange notification dots to DM and server buttons in ServerBar.
This commit is contained in:
2026-07-10 09:45:37 -04:00
parent 87d7345155
commit 56af584ede
3 changed files with 60 additions and 27 deletions
+13
View File
@@ -250,6 +250,19 @@ func main() {
r.Post("/", calHandler.CreateEvent)
})
// Threads (forum posts)
threadHandler := channel.NewHandler(database.DB, permissionsChecker)
r.Route("/channels/{channelID}/threads", func(r chi.Router) {
r.Get("/", threadHandler.ListThreads)
r.Post("/", threadHandler.CreateThread)
})
r.Patch("/threads/{threadID}", threadHandler.UpdateThread)
// Forum tags
r.Get("/channels/{channelID}/forum-tags", threadHandler.ListForumTags)
r.Post("/channels/{channelID}/forum-tags", threadHandler.CreateForumTag)
r.Delete("/forum-tags/{tagID}", threadHandler.DeleteForumTag)
// Push notifications
pushHandler.RegisterRoutes(r)