Fiskalizacija: test veze koristi URL iz forme, ne iz baze

This commit is contained in:
2026-06-24 23:26:12 +02:00
parent f69e8be988
commit 43c1963c37
2 changed files with 9 additions and 5 deletions
+8 -5
View File
@@ -912,12 +912,15 @@ func (h *Handler) TestFiskalizacije(w http.ResponseWriter, r *http.Request) {
if _, ok := h.zahtevajDozvolu(w, r, "podesavanja.pregled"); !ok {
return
}
podesavanja, err := ntechsqlite.DohvatiSvaPodesavanja(r.Context(), h.DB)
if err != nil {
http.Error(w, "Greška", http.StatusInternalServerError)
return
pfrURL := strings.TrimSpace(r.FormValue("pfr_url"))
if pfrURL == "" {
podesavanja, err := ntechsqlite.DohvatiSvaPodesavanja(r.Context(), h.DB)
if err != nil {
http.Error(w, "Greška", http.StatusInternalServerError)
return
}
pfrURL = vrednostIliDefault(podesavanja, "pfr_url", "http://127.0.0.1:4566")
}
pfrURL := vrednostIliDefault(podesavanja, "pfr_url", "http://127.0.0.1:4566")
klijent := &http.Client{Timeout: 5 * time.Second}
resp, err := klijent.Get(pfrURL + "/api/status")