chore: migrate to gitea
Some checks failed
golangci-lint / lint (push) Failing after 1m30s
Test / test (push) Failing after 2m17s

This commit is contained in:
2026-01-27 00:40:46 +01:00
parent 1e05874160
commit f8df24c29d
3169 changed files with 1216434 additions and 1587 deletions

View File

@@ -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
}
}
}