aboutsummaryrefslogtreecommitdiffstats
path: root/code/api/src/Endpoints
diff options
context:
space:
mode:
Diffstat (limited to 'code/api/src/Endpoints')
-rw-r--r--code/api/src/Endpoints/EndpointBase.cs14
-rw-r--r--code/api/src/Endpoints/V1/Labels/CreateLabelRoute.cs2
2 files changed, 4 insertions, 12 deletions
diff --git a/code/api/src/Endpoints/EndpointBase.cs b/code/api/src/Endpoints/EndpointBase.cs
index c088976..a2f55a6 100644
--- a/code/api/src/Endpoints/EndpointBase.cs
+++ b/code/api/src/Endpoints/EndpointBase.cs
@@ -1,8 +1,5 @@
-using System.Diagnostics;
-
namespace IOL.GreatOffice.Api.Endpoints;
-[ApiController]
public class EndpointBase : ControllerBase
{
/// <summary>
@@ -13,15 +10,12 @@ public class EndpointBase : ControllerBase
Id = User.FindFirstValue(AppClaims.USER_ID).AsGuid(),
};
- public ObjectResult KnownProblem(string title = default, string subtitle = default, Dictionary<string, string> errors = default) {
- return new ObjectResult(new KnownProblemModel {
+ public ActionResult KnownProblem(string title = default, string subtitle = default, Dictionary<string, string> errors = default) {
+ return BadRequest(new KnownProblemModel {
Title = title,
Subtitle = subtitle,
Errors = errors,
- TraceId = Activity.Current?.Id,
- RequestId = HttpContext.TraceIdentifier
- }) {
- StatusCode = (int) HttpStatusCode.BadRequest
- };
+ TraceId = HttpContext.TraceIdentifier
+ });
}
} \ No newline at end of file
diff --git a/code/api/src/Endpoints/V1/Labels/CreateLabelRoute.cs b/code/api/src/Endpoints/V1/Labels/CreateLabelRoute.cs
index 31ef7d0..4fe418b 100644
--- a/code/api/src/Endpoints/V1/Labels/CreateLabelRoute.cs
+++ b/code/api/src/Endpoints/V1/Labels/CreateLabelRoute.cs
@@ -1,12 +1,10 @@
namespace IOL.GreatOffice.Api.Endpoints.V1.Labels;
-/// <inheritdoc />
public class CreateLabelRoute : RouteBaseSync.WithRequest<TimeLabel.TimeLabelDto>.WithActionResult<TimeLabel.TimeLabelDto>
{
private readonly AppDbContext _context;
- /// <inheritdoc />
public CreateLabelRoute(AppDbContext context) {
_context = context;
}