public IActionResult Create([FromBody] CreateEvent eventModel)
        {
            var requestingUser  = _userRepository.GetById(_accessTokenService.GetIdFromToken(this.User));
            var desiredLocation = _locationRepository.GetById(eventModel.LocationId);
            var addedEvent      = _eventRepository.Put(eventModel, requestingUser, desiredLocation);

            return(Json(addedEvent));
        }
 public async Task <IActionResult> Create([FromBody] CreateLocation locationModel)
 {
     return(Json(
                await _locationRepository.Put(locationModel,
                                              _userRepository.GetById(_accessTokenService.GetIdFromToken(this.User)))));
 }
Esempio n. 3
0
 public IActionResult GetMe()
 {
     return(Json(Mapper.Map <ViewUser>(_userRepository.GetById(_accessTokenService.GetIdFromToken(this.User)))));
 }