Skip to content
Snippets Groups Projects
Commit 82f7975d authored by Lucca Santangelo's avatar Lucca Santangelo
Browse files

bedelia validation

parent 3a5c764a
Branches graficas-componente
Tags
No related merge requests found
Pipeline #10680 passed
......@@ -34,7 +34,7 @@ namespace Bedelia.Controllers
if (course == null)
{
return BadRequest(string.Format("el curso con nombre {0} no existe", name));
return BadRequest(string.Format("el curso con nombre {0} no existe en bedelia", name));
}
return Ok(course);
......
......@@ -56,11 +56,14 @@ namespace Tsi1.Api.Controllers
var tenantId = int.Parse(HttpContext.User.Claims.FirstOrDefault(x => x.Type == "TenantId").Value);
newCourse.TenantId = tenantId;
if (!newCourse.IsTemplate)
{
var bedeliaResult = await _bedeliaService.IsValidCourse(newCourse.Name);
if (bedeliaResult.HasError)
{
return BadRequest(bedeliaResult.Message);
}
}
var result = await _courseService.Create(newCourse);
if (result.HasError)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment