fix(documents): bind submitted CV captures to their saved revision

This commit is contained in:
cesnimda
2026-11-11 18:17:08 +01:00
parent 9f341750ec
commit e161ea3346
4 changed files with 111 additions and 7 deletions
@@ -148,8 +148,15 @@ public sealed class ApplicationAssetsController : ControllerBase
{
var user = await _users.GetUserAsync(User);
if (user is null) return Unauthorized();
var result = await _packages.CaptureAsync(user.Id, jobId, Person(user), ct);
return result is null ? NotFound() : Ok(result);
try
{
var result = await _packages.CaptureAsync(user.Id, jobId, Person(user), ct);
return result is null ? NotFound() : Ok(result);
}
catch (DbUpdateConcurrencyException)
{
return Conflict(new { code = "revision_conflict", message = "The application documents changed. Reload and review them before capturing a submitted package." });
}
}
[HttpGet("submitted-packages/{packageId:int}")]