Prevent catalog title changes during edit
Enforce immutability of CatTitle on updates: backend now rejects title changes with a BadRequest, and frontend disables the title input field when editing.
This commit is contained in:
@@ -54,6 +54,10 @@ public class CatalogsController : ControllerBase
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
if (!string.Equals(current.CatTitle, dto.CatTitle, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return BadRequest("Titel kann nicht geändert werden.");
|
||||
}
|
||||
|
||||
var updated = await _mediator.Send(new UpdateCatalogCommand(id, dto), cancellationToken);
|
||||
if (updated == null)
|
||||
|
||||
Reference in New Issue
Block a user