mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 11:43:22 +02:00
Added codes in API responses
This commit is contained in:
@@ -7,13 +7,13 @@ import (
|
||||
)
|
||||
|
||||
func SendBadRequest(c *gin.Context, message string) {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"message": message})
|
||||
c.JSON(http.StatusBadRequest, gin.H{"message": message, "code": 400})
|
||||
}
|
||||
|
||||
func SendOk(c *gin.Context, message string) {
|
||||
c.JSON(http.StatusOK, gin.H{"message": message})
|
||||
c.JSON(http.StatusOK, gin.H{"message": message, "code": 200})
|
||||
}
|
||||
|
||||
func SendForbidden(c *gin.Context, message string) {
|
||||
c.JSON(http.StatusForbidden, gin.H{"message": message})
|
||||
c.JSON(http.StatusForbidden, gin.H{"message": message, "code": 403})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user