Integrate users and books

- new table userbook linking users and book
- moved rating to users book
- updated demo data and tests
- updated front to hide routes from non connected users
This commit is contained in:
2025-10-05 16:14:53 +02:00
parent f18e6a3ba8
commit cb1f974f02
16 changed files with 143 additions and 73 deletions

View File

@@ -26,8 +26,8 @@ func setup(config *config.Config) *gin.Engine {
r := gin.Default()
r.Use(cors.New(configureCors())) // All origins allowed by default
r.Use(middleware.Auth())
r.GET("/books", func(c *gin.Context) {
api.GetBooksHanderl(c, db)
r.GET("/mybooks", func(c *gin.Context) {
api.GetMyBooksHanderl(c, db)
})
r.POST("/book", func(c *gin.Context) {
api.PostBookHandler(c, db)