Example #1
0
        public async Task <IActionResult> AddPointsToUser(int id, [FromBody] Point point)
        {
            if (string.IsNullOrEmpty(point.PayerName))
            {
                return(BadRequest());
            }

            var user = await _userService.GetAsync(id);

            if (user == null)
            {
                return(NotFound());
            }

            await _pointService.AddPointsToUser(id, point);

            return(CreatedAtAction(nameof(GetPoints), new { id = user.Id }, user));
        }