admin: Add button to switch from WIP to PROD
This commit is contained in:
parent
c34fe51641
commit
c7968fb256
3 changed files with 29 additions and 4 deletions
|
@ -47,6 +47,19 @@ func declareSettingsRoutes(router *gin.RouterGroup) {
|
|||
apiNextSettingsRoutes.DELETE("", deleteNextSettings)
|
||||
|
||||
router.POST("/reset", reset)
|
||||
|
||||
router.GET("/prod", func(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, IsProductionEnv)
|
||||
})
|
||||
router.PUT("/prod", func(c *gin.Context) {
|
||||
err := c.ShouldBindJSON(&IsProductionEnv)
|
||||
if err != nil {
|
||||
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"errmsg": err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, IsProductionEnv)
|
||||
})
|
||||
}
|
||||
|
||||
func NextSettingsHandler(c *gin.Context) {
|
||||
|
|
Reference in a new issue