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