public async Task UpdateUserNames([FromBody] UpdateNamesInput input) { var user = await UserExtractor.ProvideUserAsync(); await Transaction.ActionAsync(() => { user.FirstName = input.FirstName; user.LastName = input.LastName; }); }
public async Task <IEnumerable <ReservationsOutput> > GetCurrentUserReservations( [FromServices] GetAllReservationsQuery query, [FromQuery] ReservationsFilter filter ) { var currentUser = await UserExtractor.ProvideUserAsync(); filter.UserId = currentUser.Id; return(await query.ExecuteAsync(filter)); }
public async Task UpdateUserAvatar([FromBody] UpdateAvatarInput input) { var user = await UserExtractor.ProvideUserAsync(); await Transaction.ActionAsync(() => user.Avatar = input.Avatar); }
public async Task <ProfileOutput> GetProfile() { return(new ProfileOutput(await UserExtractor.ProvideUserAsync())); }