update uploaded files in real time for records that already have uploaded files and fix note attachment bug

This commit is contained in:
DESKTOP-T0O5CDB\DESK-555BD
2024-08-21 18:11:20 -06:00
parent a92160f6d7
commit 062e3600e7
15 changed files with 60 additions and 15 deletions

View File

@@ -1795,6 +1795,7 @@ namespace CarCareTracker.Controllers
[HttpPost]
public IActionResult SaveNoteToVehicleId(Note note)
{
note.Files = note.Files.Select(x => { return new UploadedFiles { Name = x.Name, Location = _fileHelper.MoveFileFromTemp(x.Location, "documents/") }; }).ToList();
var result = _noteDataAccess.SaveNoteToVehicle(note);
if (result)
{
@@ -2391,6 +2392,12 @@ namespace CarCareTracker.Controllers
#endregion
#region "Shared Methods"
[HttpPost]
public IActionResult GetFilesPendingUpload(List<UploadedFiles> uploadedFiles)
{
var filesPendingUpload = uploadedFiles.Where(x => x.Location.StartsWith("/temp/")).ToList();
return PartialView("_FilesToUpload", filesPendingUpload);
}
[HttpPost]
[TypeFilter(typeof(CollaboratorFilter))]
public IActionResult SearchRecords(int vehicleId, string searchQuery)
{