Skip to content

Commit

Permalink
Rename Method in MinimalAPI (#15594)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeAlhayek authored Mar 26, 2024
1 parent 15c95ca commit 1e3874d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ namespace OrchardCore.Contents.Endpoints.Api;

public static class CreateEndpoint
{
private static readonly JsonMergeSettings _updateJsonMergeSettings = new()
{
MergeArrayHandling = MergeArrayHandling.Replace,
};

public static IEndpointRouteBuilder AddCreateContentEndpoint(this IEndpointRouteBuilder builder)
{
builder.MapPost("api/content", ActionAsync)
builder.MapPost("api/content", HandleAsync)
.AllowAnonymous()
.DisableAntiforgery();

return builder;
}

private static readonly JsonMergeSettings _updateJsonMergeSettings = new()
{
MergeArrayHandling = MergeArrayHandling.Replace,
};

[Authorize(AuthenticationSchemes = "Api")]
private static async Task<IResult> ActionAsync(
private static async Task<IResult> HandleAsync(
ContentItem model,
IContentManager contentManager,
IAuthorizationService authorizationService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ public static class DeleteEndpoint
{
public static IEndpointRouteBuilder AddDeleteContentEndpoint(this IEndpointRouteBuilder builder)
{
builder.MapDelete("api/content/{contentItemId}", ActionAsync)
builder.MapDelete("api/content/{contentItemId}", HandleAsync)
.AllowAnonymous()
.DisableAntiforgery();

return builder;
}

[Authorize(AuthenticationSchemes = "Api")]
private static async Task<IResult> ActionAsync(
private static async Task<IResult> HandleAsync(
string contentItemId,
IContentManager contentManager,
IAuthorizationService authorizationService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ public static class GetEndpoint
{
public static IEndpointRouteBuilder AddGetContentEndpoint(this IEndpointRouteBuilder builder)
{
builder.MapGet("api/content/{contentItemId}", ActionAsync)
builder.MapGet("api/content/{contentItemId}", HandleAsync)
.AllowAnonymous()
.DisableAntiforgery();

return builder;
}

[Authorize(AuthenticationSchemes = "Api")]
private static async Task<IResult> ActionAsync(
private static async Task<IResult> HandleAsync(
string contentItemId,
IContentManager contentManager,
IAuthorizationService authorizationService,
Expand Down

0 comments on commit 1e3874d

Please sign in to comment.