Refactor code to use 'any' type and improve context handling
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"vctp/internal/report"
|
||||
@@ -16,8 +15,8 @@ import (
|
||||
// @Failure 500 {object} models.ErrorResponse "Report generation failed"
|
||||
// @Router /api/report/inventory [get]
|
||||
func (h *Handler) InventoryReportDownload(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
ctx := context.Background()
|
||||
ctx, cancel := withRequestTimeout(r, reportRequestTimeout)
|
||||
defer cancel()
|
||||
|
||||
// Generate the XLSX report
|
||||
reportData, err := report.CreateInventoryReport(h.Logger, h.Database, ctx)
|
||||
@@ -45,8 +44,8 @@ func (h *Handler) InventoryReportDownload(w http.ResponseWriter, r *http.Request
|
||||
// @Failure 500 {object} models.ErrorResponse "Report generation failed"
|
||||
// @Router /api/report/updates [get]
|
||||
func (h *Handler) UpdateReportDownload(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
ctx := context.Background()
|
||||
ctx, cancel := withRequestTimeout(r, reportRequestTimeout)
|
||||
defer cancel()
|
||||
|
||||
// Generate the XLSX report
|
||||
reportData, err := report.CreateUpdatesReport(h.Logger, h.Database, ctx)
|
||||
|
||||
Reference in New Issue
Block a user