fix(documents): reject profile changes during submitted CV rendering
This commit is contained in:
@@ -81,6 +81,10 @@ public sealed class SubmittedApplicationPackageService : ISubmittedApplicationPa
|
||||
.Select(v => new { v.Version, v.SettingsJson }).SingleOrDefaultAsync(ct);
|
||||
if (render is null || current is null || current.Version != variant.Version || current.SettingsJson != variant.SettingsJson)
|
||||
throw new DbUpdateConcurrencyException("The selected CV changed before the submitted package could be captured.");
|
||||
var currentProfile = await _db.CareerProfiles.AsNoTracking().Where(p => p.OwnerUserId == ownerUserId)
|
||||
.Select(p => new { p.Version, p.ProfileJson }).FirstOrDefaultAsync(ct);
|
||||
if (currentProfile?.Version != profile?.Version || currentProfile?.ProfileJson != profile?.ProfileJson)
|
||||
throw new DbUpdateConcurrencyException("The Career Profile changed before the submitted package could be captured.");
|
||||
}
|
||||
var version = (await _db.SubmittedApplicationPackages.AsNoTracking()
|
||||
.Where(x => x.OwnerUserId == ownerUserId && x.JobApplicationId == jobApplicationId)
|
||||
|
||||
Reference in New Issue
Block a user