User can change a character from private to public and back

This commit is contained in:
2026-02-01 20:55:44 +01:00
parent 2195ea55c0
commit 5152600ea3
6 changed files with 231 additions and 1 deletions
+2
View File
@@ -10,6 +10,8 @@ func RegisterRoutes(r *gin.RouterGroup) {
charGrp.POST("", CreateCharacter)
charGrp.GET("/:id", GetCharacter)
charGrp.PUT("/:id", UpdateCharacter)
charGrp.PATCH("/:id", UpdateCharacter)
charGrp.DELETE("/:id", DeleteCharacter)
charGrp.PUT("/:id/image", UpdateCharacterImage)
charGrp.GET("/:id/datasheet-options", GetDatasheetOptions)
+1 -1
View File
@@ -21,7 +21,7 @@ func SetupGin(r *gin.Engine) {
r.Use(cors.New(cors.Config{
//AllowOrigins: []string{"http://localhost:3000"}, // Replace with your frontend's URL
AllowOrigins: allowedOrigins,
AllowMethods: []string{"GET", "POST", "PUT", "DELETE"},
AllowMethods: []string{"GET", "POST", "PUT", "PATCH", "DELETE"},
AllowHeaders: []string{"Origin", "Content-Type", "Authorization"},
ExposeHeaders: []string{"Content-Length"},
AllowCredentials: true,