Implemented caching on all get endpoints and service layer
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
using PostFundManagement.Application.Abstractions.Services;
|
||||
using PostFundManagement.Application.Extensions;
|
||||
using PostFundManagement.Application.Services.Governance;
|
||||
using PostFundManagement.Domain.Abstractions;
|
||||
using PostFundManagement.Domain.Errors;
|
||||
using PostFundManagement.Domain.Extensions;
|
||||
@@ -15,7 +15,7 @@ public class GetOrganisationEndpoint : IEndpoint
|
||||
public void Map(IEndpointRouteBuilder builder)
|
||||
{
|
||||
builder.MapGet("api/governance/organisations/{organisationId}", async (string organisationId,
|
||||
GovernanceService service, CancellationToken cancellationToken = default) =>
|
||||
IGovernanceService service, CancellationToken cancellationToken = default) =>
|
||||
await service.GetOrganisationAsync(organisationId, cancellationToken) switch
|
||||
{
|
||||
{ IsSuccess: true, Value: var organisation } => Results.Ok(organisationId),
|
||||
@@ -31,6 +31,7 @@ public class GetOrganisationEndpoint : IEndpoint
|
||||
.Produces(StatusCodes.Status401Unauthorized)
|
||||
.Produces(StatusCodes.Status403Forbidden)
|
||||
.Produces<Problems>(StatusCodes.Status500InternalServerError)
|
||||
.WithTags(EndpointTags.Governance);
|
||||
.WithTags(EndpointTags.Governance)
|
||||
.CacheOutput();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user