Beispiel #1
0
        public async Task <IActionResult> ChangeDetails([FromBody] UpdateSessionModel model, Guid sessionId)
        {
            if (!User.IsInRole("Admin") && (await _sessionService.GetSessionById(sessionId)).HostId == userId)
            {
                return(Unauthorized());
            }

            try
            {
                await _sessionService.ChangeSession(sessionId, model);

                return(Ok(new { message = "" }));
            }
            catch (AppException ex)
            {
                return(BadRequest(new { message = ex.Message }));
            }
        }