webhook payload update.

This commit is contained in:
DESKTOP-T0O5CDB\DESK-555BD
2024-12-11 14:40:36 -07:00
parent 5fcf54de09
commit a34921701d
2 changed files with 40 additions and 11 deletions

View File

@@ -32,10 +32,11 @@ namespace CarCareTracker.Controllers
return Json(false);
}
note.Files = note.Files.Select(x => { return new UploadedFiles { Name = x.Name, Location = _fileHelper.MoveFileFromTemp(x.Location, "documents/") }; }).ToList();
bool isCreate = note.Id == default; //needed here since Notes don't use an input object.
var result = _noteDataAccess.SaveNoteToVehicle(note);
if (result)
{
StaticHelper.NotifyAsync(_config.GetWebHookUrl(), WebHookPayload.FromNoteRecord(note, note.Id == default ? "noterecord.add" : "noterecord.update", User.Identity.Name));
StaticHelper.NotifyAsync(_config.GetWebHookUrl(), WebHookPayload.FromNoteRecord(note, isCreate ? "noterecord.add" : "noterecord.update", User.Identity.Name));
}
return Json(result);
}