Merge pull request #158 from hargata/Hargata/reminder.email.endpoint

stop method from returning prematurely.
This commit is contained in:
Hargata Softworks 2024-01-24 22:27:32 -07:00 committed by GitHub
commit b837a2e528
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -452,7 +452,7 @@ namespace CarCareTracker.Controllers
results.RemoveAll(x => !urgencies.Contains(x.Urgency));
if (!results.Any())
{
return Json(new OperationResponse { Success = false, Message = "No reminders could be found with those parameters" });
continue;
}
//get list of recipients.
var userIds = _userAccessDataAccess.GetUserAccessByVehicleId(vehicleId).Select(x => x.Id.UserId);
@ -464,7 +464,7 @@ namespace CarCareTracker.Controllers
};
if (!emailRecipients.Any())
{
return Json(new OperationResponse { Success = false, Message = "No recipients could be found with those parameters" });
continue;
}
var result = _mailHelper.NotifyUserForReminders(vehicle, emailRecipients, results);
operationResponses.Add(result);