Academatica.Api/Academatica.Api.Users/Controllers/UsersController.cs
/// <summary>
/// Endpoint used to get the amount of user's lifebuoys.
/// </summary>
/// <param name="id">User ID.</param>
Endpoint used to get the amount of user's lifebuoys.
Endpoint used to get the amount of user ' s lifebuoys .
[HttpGet]
        [Route("{id}/buoys")]
        public IActionResult GetUserBuoys(Guid id)
        {
            var userStats = _academaticaDbContext.UserStats.Where(x => x.UserId == id).FirstOrDefault();
            if (userStats == null)
            {
                return NotFound("Stats entry could not be found.");
            }
            return Ok(new GetUserBuoysResponseDto()
            {
                BuoysLeft = userStats.BuoysLeft
            });
        }
[ HttpGet ] [ Route ( " " ) ] public IActionResult GetUserBuoys ( Guid id ) { var userStats = _academaticaDbContext . UserStats . Where ( x => x . UserId == id ) . FirstOrDefault ( ) ; if ( userStats == null ) { return NotFound ( " " ) ; } return Ok ( new GetUserBuoysResponseDto ( ) { BuoysLeft = userStats . BuoysLeft } ) ; }
Endpoint used to get the amount of user's lifebuoys.
Endpoint used to get the amount of user ' s lifebuoys .
id
Guid
None