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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user