Fixed errors
This commit is contained in:
parent
90e980be98
commit
76085be47d
Binary file not shown.
Binary file not shown.
@ -40,7 +40,11 @@ namespace StudyLib.API.Controllers
|
|||||||
return NotFound();
|
return NotFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
subject.EditedBy = userId;
|
if (subject.EditedBy == null)
|
||||||
|
{
|
||||||
|
subject.EditedBy = userId;
|
||||||
|
}
|
||||||
|
|
||||||
_context.Entry(subject).State = EntityState.Modified;
|
_context.Entry(subject).State = EntityState.Modified;
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
@ -55,6 +59,7 @@ namespace StudyLib.API.Controllers
|
|||||||
return BadRequest();
|
return BadRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
subject.EditedBy = null;
|
||||||
_context.Entry(subject).State = EntityState.Modified;
|
_context.Entry(subject).State = EntityState.Modified;
|
||||||
foreach (var comment in subject.Comments)
|
foreach (var comment in subject.Comments)
|
||||||
{
|
{
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user