Added Conditional OperationalResponse constructor.

This commit is contained in:
DESKTOP-T0O5CDB\DESK-555BD
2024-11-19 13:04:40 -07:00
parent f629834d6a
commit 03b9331a9a
11 changed files with 65 additions and 128 deletions

View File

@@ -41,7 +41,7 @@ namespace CarCareTracker.Helper
var result = SendEmail(new List<string> { emailAddress }, emailSubject, emailBody);
if (result)
{
return new OperationResponse { Success = true, Message = "Email Sent!" };
return OperationResponse.Succeed("Email Sent!");
} else
{
return OperationResponse.Failed();
@@ -62,7 +62,7 @@ namespace CarCareTracker.Helper
var result = SendEmail(new List<string> { emailAddress }, emailSubject, emailBody);
if (result)
{
return new OperationResponse { Success = true, Message = "Email Sent!" };
return OperationResponse.Succeed("Email Sent!");
}
else
{
@@ -84,7 +84,7 @@ namespace CarCareTracker.Helper
var result = SendEmail(new List<string> { emailAddress}, emailSubject, emailBody);
if (result)
{
return new OperationResponse { Success = true, Message = "Email Sent!" };
return OperationResponse.Succeed("Email Sent!");
}
else
{
@@ -123,7 +123,7 @@ namespace CarCareTracker.Helper
var result = SendEmail(emailAddresses, emailSubject, emailBody);
if (result)
{
return new OperationResponse { Success = true, Message = "Email Sent!" };
return OperationResponse.Succeed("Email Sent!");
} else
{
return OperationResponse.Failed();

View File

@@ -159,7 +159,7 @@ namespace CarCareTracker.Helper
//write to file
File.WriteAllText(translationFilePath, JsonSerializer.Serialize(translations));
}
return new OperationResponse { Success = true, Message = "Translation Updated" };
return OperationResponse.Succeed("Translation Updated");
}
catch (Exception ex)
{