mirror of
https://github.com/Shchoholiev/shopping-assistant-api.git
synced 2025-04-03 16:19:46 +00:00
20 lines
804 B
C#
20 lines
804 B
C#
using ShoppingAssistantApi.Application.IServices.Identity;
|
|
using ShoppingAssistantApi.Application.Models.Dtos;
|
|
using ShoppingAssistantApi.Application.Models.Operations;
|
|
using HotChocolate.Authorization;
|
|
|
|
namespace ShoppingAssistantApi.Api.Mutations;
|
|
|
|
[ExtendObjectType(OperationTypeNames.Mutation)]
|
|
public class UsersMutation
|
|
{
|
|
[Authorize]
|
|
public Task<UpdateUserModel> UpdateUserAsync(UserDto userDto, CancellationToken cancellationToken,
|
|
[Service] IUserManager userManager)
|
|
=> userManager.UpdateAsync(userDto, cancellationToken);
|
|
|
|
[Authorize]
|
|
public Task<UpdateUserModel> UpdateUserByAdminAsync(string id, UserDto userDto, CancellationToken cancellationToken,
|
|
[Service] IUserManager userManager)
|
|
=> userManager.UpdateUserByAdminAsync(id, userDto, cancellationToken);
|
|
} |