Skip to content

Commit

Permalink
Merge pull request #776 from bcgov/yj
Browse files Browse the repository at this point in the history
Yj
  • Loading branch information
ychung-mot authored Nov 6, 2024
2 parents 24224ba + 7f4071d commit 8d173ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion server/StrDss.Api/Authentication/KcJwtBearerEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using StrDss.Model.UserDtos;
using StrDss.Service;
using StrDss.Service.Bceid;
using System.Net;

namespace StrDss.Api.Authentication
{
Expand Down Expand Up @@ -48,6 +47,7 @@ public override async Task TokenValidated(TokenValidatedContext context)
_currentUser.OrganizationId = user.RepresentedByOrganizationId ?? 0;
_currentUser.OrganizationName = user.RepresentedByOrganization?.OrganizationNm ?? "";
_currentUser.TermsAcceptanceDtm = user.TermsAcceptanceDtm;
_currentUser.EmailAddress = user.EmailAddressDsc ?? "";

if (user.IsEnabled)
{
Expand Down
9 changes: 9 additions & 0 deletions server/StrDss.Service/DelistingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,7 @@ private async Task ProcessComplianceOrderListings(ComplianceOrderDto[] listings,
List<ComplianceOrderFromListing> templates)
{
var emailRegex = RegexDefs.GetRegexInfo(RegexDefs.Email);
var commentError = false;

foreach (var listing in listings)
{
Expand All @@ -1115,13 +1116,21 @@ private async Task ProcessComplianceOrderListings(ComplianceOrderDto[] listings,

listing.HostEmails = GetValidHostEmails(rentalListing.Hosts.ToArray(), emailRegex);

if (listing.Comment.Length > 3900)
commentError = true;

template.OrgCd = rentalListing.OfferingOrganizationCd!;
template.RentalListingId = rentalListing.RentalListingId ?? 0;
template.To = listing.HostEmails;
template.Bcc = listing.BccList;
template.Comment = listing.Comment;
templates.Add(template);
}

if (commentError)
{
errors.AddItem("comment", "Your message to hosts exceeds the maximum allowed length of 3,900 characters. Please shorten your message and try again.");
}
}
public async Task<Dictionary<string, List<string>>> CreateComplianceOrdersFromListingAsync(ComplianceOrderDto[] listings)
{
Expand Down

0 comments on commit 8d173ed

Please sign in to comment.