Exemplo n.º 1
0
        public async Task <IActionResult> BuyEducation(ByIdRequestModel model)
        {
            if (model.Id == Guid.Empty)
            {
                return(Json(new { failed = true, message = "Null educationId." }));
            }

            model.UserId = User.Identity.GetUserId();

            var education = await _userEducationService.BuyEducation(model);

            if (education != null)
            {
                return(Json(new { failed = false, message = "Added education" }));
            }
            else
            {
                return(Json(new { failed = true, message = "An error occurred" }));
            }
        }