This repository has been archived on 2026-01-02. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
cover-letter-templater/backend/utils/responses.go
T
2025-07-05 22:17:14 +03:00

22 lines
329 B
Go

package utils
import (
"github.com/gin-gonic/gin"
)
func Success(c *gin.Context, data gin.H) {
// Return success to api
c.JSON(200, gin.H{
"success": true,
"data": data,
})
}
func Error(c *gin.Context, err string, code int) {
// Return error to api
c.JSON(code, gin.H{
"success": false,
"error": err,
})
}