Progresss
This commit is contained in:
@@ -39,7 +39,7 @@ namespace KTUSAPS.Controllers
|
||||
if (publishedProblem.Id != default)
|
||||
return BadRequest("Id has been set on create request, please do not do that, set id to 0 or ommit it.");
|
||||
if (publishedProblem.Issue != null || publishedProblem.Solution != null || publishedProblem.Votes != null)
|
||||
return BadRequest("Do not privide navigation property values.");
|
||||
return BadRequest("Do not provide navigation property values.");
|
||||
|
||||
_context.PublishedProblems.Add(publishedProblem);
|
||||
await _context.SaveChangesAsync();
|
||||
@@ -61,9 +61,9 @@ namespace KTUSAPS.Controllers
|
||||
}
|
||||
|
||||
[HttpPatch("{id}")]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> UpdatePublishedProblem(int id, PublishedProblem publishedProblem)
|
||||
public async Task<ActionResult<PublishedProblem>> UpdatePublishedProblem(int id, PublishedProblem publishedProblem)
|
||||
{
|
||||
var databasePublishedProblem = await _context.PublishedProblems.FindAsync(id);
|
||||
if (databasePublishedProblem == default)
|
||||
@@ -82,7 +82,7 @@ namespace KTUSAPS.Controllers
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
return NoContent();
|
||||
return Ok(ePublishedProblem.Entity);
|
||||
}
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace KTUSAPS.Controllers
|
||||
}
|
||||
|
||||
[HttpPost("{id}/Votes")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status201Created)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<ActionResult<Vote>> Vote(int id, Vote vote)
|
||||
|
Reference in New Issue
Block a user