Compare commits

...

3 Commits

Author SHA1 Message Date
Nicolas CARON a1adc028df edit DiagsHistory in diags handlers
Build and Push Docker Image / build_and_push (push) Failing after 1m37s Details
2024-12-18 16:00:38 +01:00
Nicolas CARON c7ac48d373 add namespace parcoursmob_bookings on diags handlers 2024-12-17 10:33:17 +01:00
Nicolas CARON f862440fd4 add namespace parcoursmob_bookings on diags handlers 2024-12-17 10:32:35 +01:00
2 changed files with 6 additions and 3 deletions

View File

@ -39,7 +39,7 @@ type DiagsForm struct {
func (h *ApplicationHandler) DiagsHome(w http.ResponseWriter, r *http.Request) {
resp, err := h.services.GRPC.Diags.GetDiags(context.TODO(), &diags.GetDiagsRequest{
Namespaces: []string{"parcoursmob_beneficiaries", "parcoursmob_diagnostiques", "parcoursmob_vehicles"},
Namespaces: []string{"parcoursmob_beneficiaries", "parcoursmob_diagnostiques", "parcoursmob_vehicles", "parcoursmob_bookings"},
// Mindate: timestamppb.New(time.Now().Add(-24 * time.Hour)),
})
@ -60,7 +60,7 @@ func (h *ApplicationHandler) DiagsHome(w http.ResponseWriter, r *http.Request) {
func (h *ApplicationHandler) DiagsHistory(w http.ResponseWriter, r *http.Request) {
resp, err := h.services.GRPC.Diags.GetDiags(context.TODO(), &diags.GetDiagsRequest{
Namespaces: []string{"parcoursmob_diagnostiques"},
Namespaces: []string{"parcoursmob_beneficiaries", "parcoursmob_diagnostiques", "parcoursmob_vehicles", "parcoursmob_bookings"},
//Maxdate: timestamppb.New(time.Now().Add(24 * time.Hour)),
})
@ -73,7 +73,9 @@ func (h *ApplicationHandler) DiagsHistory(w http.ResponseWriter, r *http.Request
responses := []diagsstorage.Diag{}
for _, e := range resp.Diags {
responses = append(responses, e.ToStorageType())
if e.Deleted {
responses = append(responses, e.ToStorageType())
}
}
h.Renderer.DiagsHistory(w, r, responses)

View File

@ -203,6 +203,7 @@ func main() {
application.HandleFunc("/diags/{diagid}", applicationHandler.DiagsDisplayDiag)
application.HandleFunc("/diags/{diagid}/update", applicationHandler.DiagUpdate)
application.HandleFunc("/diags/{diagid}/delete", applicationHandler.DiagDelete)
// application.HandleFunc("/diags/history", applicationHandler.DiagsHistory)
export := r.PathPrefix("/exports").Subrouter()
export.HandleFunc("/fleets/bookings", exportsHandler.Bookings)