new error codes, code refactor, added getMessages function

This commit is contained in:
slawk0
2025-02-07 22:59:36 +01:00
parent 51b426ba54
commit 7342c5b483
9 changed files with 189 additions and 31 deletions

View File

@@ -21,9 +21,13 @@ func SetupRoutes(app *fiber.App) {
auth.Get("/validate", middleware.Protected(), handlers.ValidateToken)
// Contacts group
contacts := chat.Group("/contacts", middleware.Protected(), logger.New())
contacts.Delete("/:contact_id/:conversation_id", handlers.DeleteContact)
contacts.Post("/:contact_username", handlers.InsertContact)
contacts := chat.Group("/contact", middleware.Protected(), logger.New())
contacts.Delete("/:contactID/:conversation_id", handlers.DeleteContact)
contacts.Post("/:contactUsername", handlers.InsertContact)
contacts.Get("/", handlers.GetContacts)
contacts.Get("/suggestions/:contactUsername", handlers.GetContactSuggestions)
// Messages group
messages := chat.Group("/messages", middleware.Protected(), logger.New())
messages.Get("/:conversationID", handlers.GetMessages)
}