Refactored organisation entities and endpoints
This commit is contained in:
@@ -19,6 +19,7 @@ public sealed class CreateOrganisationEndpoint : IEndpoint
|
||||
await service.CreateOrganisationAsync(request, context.GetUserId(), cancellationToken) switch
|
||||
{
|
||||
{ IsSuccess: true } => Results.Ok(),
|
||||
var r when r.HasError<ValidationError>() => Results.BadRequest(r.Errors.ToProblems()),
|
||||
var r when r.HasError<CreateError>() => Results.BadRequest(r.Errors.ToProblems()),
|
||||
var r => Results.InternalServerError(r.Errors.ToProblems())
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user