form
This commit is contained in:
parent
7fc9eef637
commit
b80372b367
@ -96,10 +96,14 @@ namespace InternshipSystem.Api.Controllers
|
||||
await _context.Entry(edition)
|
||||
.Collection(e => e.Internships)
|
||||
.Query()
|
||||
.Include(i => i.Documentation)
|
||||
.Include(i => i.Documentation)
|
||||
.FirstAsync(i => i.Student.Id == user.PersonNumber, cancellationToken);
|
||||
|
||||
var document = internship.Documentation.First(d => d.Id == documentId);
|
||||
var document = await _context.Entry(internship)
|
||||
.Collection(i => i.Documentation)
|
||||
.Query()
|
||||
.Include(d => d.Scan)
|
||||
.FirstAsync(d => d.Id == documentId, cancellationToken);
|
||||
|
||||
document.Scan ??= new DocumentScan();
|
||||
|
||||
@ -109,7 +113,7 @@ namespace InternshipSystem.Api.Controllers
|
||||
document.Scan.File = memoryStream.ToArray();
|
||||
|
||||
document.State = DocumentState.Submitted;
|
||||
|
||||
|
||||
await _context.SaveChangesAsync(cancellationToken);
|
||||
|
||||
return Ok();
|
||||
|
Loading…
Reference in New Issue
Block a user