Edit beneficiaries handlers to show diags

This commit is contained in:
Nicolas CARON 2024-12-04 14:11:49 +01:00
parent a2a3ac5ffe
commit 1c4371b121
1 changed files with 16 additions and 13 deletions

View File

@ -313,17 +313,20 @@ func (h *ApplicationHandler) BeneficiaryDisplay(w http.ResponseWriter, r *http.R
sortByDate(events_list)
diag := []diagsstorage.Diag{}
for _, e := range diag {
diagrequest := &diags.GetDiagRequest{
Id: e.ID,
diagsrequest := &diags.GetDiagsRequest{
Namespaces: []string{"parcoursmob_beneficiaries"},
}
diagresp, err := h.services.GRPC.Diags.GetDiag(context.TODO(), diagrequest)
diagsresp, err := h.services.GRPC.Diags.GetDiags(context.TODO(), diagsrequest)
if err != nil {
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
diag = append(diag, diagresp.Diag.ToStorageType())
for _, d := range diagsresp.Diags {
diag = append(diag, d.ToStorageType())
}
groupsrequest := &groupsmanagement.GetGroupsRequest{