chore: migrate to gitea
This commit is contained in:
@@ -1,16 +1,20 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"budget/internal/storage/model"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"gitea.frenchtouch.duckdns.org/kratisto/budget-backend/internal/storage/model"
|
||||
)
|
||||
|
||||
func JSON(w http.ResponseWriter, status int, data interface{}) {
|
||||
w.Header().Set(HeaderNameContentType, HeaderValueApplicationJSONUTF8)
|
||||
w.WriteHeader(status)
|
||||
if data != nil {
|
||||
json.NewEncoder(w).Encode(data)
|
||||
err := json.NewEncoder(w).Encode(data)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user