From 819214d8093776ffefc21e6257bca7d29261a0d1 Mon Sep 17 00:00:00 2001 From: Yossi Tamari Date: Fri, 12 Jul 2024 16:51:19 -0700 Subject: [PATCH] EMBCESSMOD-5628: fix for supplier list error --- .../API/EMBC.Responders.API/Controllers/SuppliersController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/responders/src/API/EMBC.Responders.API/Controllers/SuppliersController.cs b/responders/src/API/EMBC.Responders.API/Controllers/SuppliersController.cs index bc0982b83e..458049a9da 100644 --- a/responders/src/API/EMBC.Responders.API/Controllers/SuppliersController.cs +++ b/responders/src/API/EMBC.Responders.API/Controllers/SuppliersController.cs @@ -308,7 +308,7 @@ public SuppliersMapping() .ForMember(d => d.Status, opts => opts.MapFrom(s => s.Status == ESS.Shared.Contracts.Teams.SupplierStatus.Active ? SupplierStatus.Active : SupplierStatus.Deactivated)) .ForMember(d => d.IsPrimarySupplier, opts => opts.MapFrom((s, dst, arg, context) => context.Items.ContainsKey("UserTeamId") && s.PrimaryTeams.Any(t => t.Id.Equals(context.Items["UserTeamId"])))) .ForMember(d => d.ProvidesMutualAid, opts => opts.MapFrom((s, dst, arg, context) => context.Items.ContainsKey("UserTeamId") && s.PrimaryTeams.Any(t => t.Id.Equals(context.Items["UserTeamId"])) && s.MutualAids.Any())) - .ForMember(d => d.MutualAid, opts => opts.MapFrom((s, dst, arg, context) => s.MutualAids.SingleOrDefault(ma => context.Items.ContainsKey("UserTeamId") && ma.GivenToTeam.Equals(context.Items["UserTeamId"])))) + .ForMember(d => d.MutualAid, opts => opts.MapFrom((s, dst, arg, context) => s.MutualAids.SingleOrDefault(ma => context.Items.ContainsKey("UserTeamId") && ma.GivenToTeam != null && ma.GivenToTeam.Equals(context.Items["UserTeamId"])))) ; CreateMap()