mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
restructure seed
This commit is contained in:
@@ -4,10 +4,10 @@ namespace WebAPI.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
[Route("error")] // ← required
|
||||
[Route("error")] // ← required
|
||||
public class NotFoundController : ControllerBase
|
||||
{
|
||||
[HttpGet("404")] // ← required
|
||||
[HttpGet("404")] // ← required
|
||||
public IActionResult Handle404()
|
||||
{
|
||||
return NotFound(new { message = "Route not found." });
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using DataAccessLayer.Entities;
|
||||
using BusinessLayer.Services;
|
||||
using DataAccessLayer.Entities;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace WebAPI.Controllers
|
||||
@@ -79,9 +79,15 @@ namespace WebAPI.Controllers
|
||||
}
|
||||
|
||||
[HttpPut("{id:guid}")]
|
||||
public IActionResult UpdateUser(Guid id, [FromBody] UserAccount userAccount)
|
||||
public IActionResult UpdateUser(
|
||||
Guid id,
|
||||
[FromBody] UserAccount userAccount
|
||||
)
|
||||
{
|
||||
if (userAccount.UserAccountID != Guid.Empty && userAccount.UserAccountID != id)
|
||||
if (
|
||||
userAccount.UserAccountID != Guid.Empty
|
||||
&& userAccount.UserAccountID != id
|
||||
)
|
||||
{
|
||||
return BadRequest("UserAccountID does not match route id.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user