Fix product performance grouped JSON build
This commit is contained in:
@@ -197,11 +197,12 @@ func GetProductionHasCostProductsHandler(w http.ResponseWriter, r *http.Request)
|
||||
search := strings.TrimSpace(r.URL.Query().Get("search"))
|
||||
offset := parsePositiveIntOrDefault(r.URL.Query().Get("offset"), 0)
|
||||
limit := parsePositiveIntOrDefault(r.URL.Query().Get("limit"), 300)
|
||||
nFirmaID, _ := strconv.Atoi(strings.TrimSpace(r.URL.Query().Get("n_firma_id")))
|
||||
if limit > 1000 {
|
||||
limit = 1000
|
||||
}
|
||||
|
||||
rows, err := queries.GetProductionHasCostProducts(r.Context(), uretimDB, search, offset, limit)
|
||||
rows, err := queries.GetProductionHasCostProducts(r.Context(), uretimDB, search, offset, limit, nFirmaID)
|
||||
if err != nil {
|
||||
log.Printf("❌ [ProductionHasCost] query error: %v", err)
|
||||
http.Error(w, "Veritabanı hatası", http.StatusInternalServerError)
|
||||
|
||||
Reference in New Issue
Block a user