mirror of
https://github.com/Shchoholiev/shopping-assistant-api.git
synced 2025-04-03 16:19:46 +00:00
15 lines
544 B
C#
15 lines
544 B
C#
using HotChocolate.Authorization;
|
|
using ShoppingAssistantApi.Application.IServices;
|
|
using ShoppingAssistantApi.Application.Models.CreateDtos;
|
|
using ShoppingAssistantApi.Application.Models.Dtos;
|
|
|
|
namespace ShoppingAssistantApi.Api.Mutations;
|
|
|
|
[ExtendObjectType(OperationTypeNames.Mutation)]
|
|
public class RolesMutation
|
|
{
|
|
[Authorize]
|
|
public Task<RoleDto> AddRole(RoleCreateDto roleDto, CancellationToken cancellationToken,
|
|
[Service] IRolesService rolesService)
|
|
=> rolesService.AddRoleAsync(roleDto, cancellationToken);
|
|
} |