Fixed app settings

This commit is contained in:
Chase Tucker 2025-01-17 10:24:26 -07:00
parent 7ddda56987
commit e68a1a4c3b

View File

@ -8,7 +8,7 @@ namespace Fab2ApprovalSystem.Models;
public class AppSettings { public class AppSettings {
public AppSettings(string adminNotificationRecepient, public AppSettings(string adminNotificationRecepient,
string? apiBaseUrl, string apiBaseUrl,
string attachmentFolder, string attachmentFolder,
string? attachmentUrl, string? attachmentUrl,
string caBlankFormsLocation, string caBlankFormsLocation,
@ -94,7 +94,7 @@ public class AppSettings {
} }
public string AdminNotificationRecepient { get; } public string AdminNotificationRecepient { get; }
public string? ApiBaseUrl { get; } public string ApiBaseUrl { get; }
public string AttachmentFolder { get; } public string AttachmentFolder { get; }
public string? AttachmentUrl { get; } public string? AttachmentUrl { get; }
public string CABlankFormsLocation { get; } public string CABlankFormsLocation { get; }
@ -214,7 +214,8 @@ public class AppSettings {
throw new ArgumentNullException("SSRSPassword environment variable not found"); throw new ArgumentNullException("SSRSPassword environment variable not found");
string testEmailRecipients = ConfigurationManager.AppSettings["Test Email Recipients"] ?? string testEmailRecipients = ConfigurationManager.AppSettings["Test Email Recipients"] ??
throw new ArgumentNullException("Test Email Recipients environment variable not found"); throw new ArgumentNullException("Test Email Recipients environment variable not found");
string? apiBaseUrl = ConfigurationManager.AppSettings["FabApprovalApiBaseUrl"]?.ToString(); string apiBaseUrl = Environment.GetEnvironmentVariable("FabApprovalApiBaseUrl") ??
throw new ArgumentNullException("FabApprovalApiBaseUrl environment variable not found");
string? attachmentUrl = ConfigurationManager.AppSettings["AttachmentUrl"]?.ToString(); string? attachmentUrl = ConfigurationManager.AppSettings["AttachmentUrl"]?.ToString();
string? company = ConfigurationManager.AppSettings["Company"]?.ToString(); string? company = ConfigurationManager.AppSettings["Company"]?.ToString();
string? smtpServer = ConfigurationManager.AppSettings["SMTP Server"]?.ToString(); string? smtpServer = ConfigurationManager.AppSettings["SMTP Server"]?.ToString();