fix(api): harden billing/blog validation and update rc14 changelog
All checks were successful
Dotnet build and test / build (pull_request) Successful in 9m35s
All checks were successful
Dotnet build and test / build (pull_request) Successful in 9m35s
This commit is contained in:
parent
369a8eb3c8
commit
d65624bfb8
13 changed files with 168 additions and 53 deletions
|
|
@ -82,19 +82,17 @@ public class HairCutQueryApiController : Controller
|
|||
public async Task<IActionResult> PostQuery([FromBody] HairCutQuery query, CancellationToken cancellationToken)
|
||||
{
|
||||
var uid = User.GetUserId();
|
||||
if (string.IsNullOrWhiteSpace(query.ClientId))
|
||||
{
|
||||
query.ClientId = uid;
|
||||
}
|
||||
query.ClientId = uid;
|
||||
|
||||
ModelState.Remove("Client");
|
||||
ModelState.Remove("ClientId");
|
||||
ModelState.Remove("UserCreated");
|
||||
ModelState.Remove("UserModified");
|
||||
ModelState.Remove("SelectedProfile");
|
||||
ModelState.Remove("Prestation");
|
||||
|
||||
if (query.ClientId != uid && !User.IsInRole(Constants.AdminGroupName))
|
||||
{
|
||||
ModelState.AddModelError("ClientId", "You can only create your own HairCutQuery");
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
ModelState.Remove("PerformerProfile");
|
||||
ModelState.Remove("Context");
|
||||
ModelState.Remove("Regularization");
|
||||
|
||||
query.Prestation = await _context.HairPrestation
|
||||
.SingleOrDefaultAsync(p => p.Id == query.PrestationId, cancellationToken);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue