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

@@ -419,7 +419,7 @@ namespace CarCareTracker.Controllers
#endregion
var destFilePath = $"{fullFolderPath}.zip";
ZipFile.CreateFromDirectory(fullFolderPath, destFilePath);
return Json(new OperationResponse { Success = true, Message = $"/{tempFolder}.zip" });
return Json(OperationResponse.Succeed($"/{tempFolder}.zip"));
}
catch (Exception ex)
{
@@ -744,7 +744,7 @@ namespace CarCareTracker.Controllers
}
}
#endregion
return Json(new OperationResponse { Success = true, Message = "Data Imported Successfully" });
return Json(OperationResponse.Succeed("Data Imported Successfully"));
}
catch (Exception ex)
{