public IActionResult UpsertBulletPointToPage([FromRoute] int pageId, [FromRoute] int bulletPointId, [FromBody] BulletPoint data) { BulletPointService bulletPointService = new BulletPointService(Settings.GetSection("AppSettings").GetSection("DefaultConnectionString").Value); bulletPointService.UpsertBulletPointForPage(pageId, bulletPointId, data); return(Ok()); }
public IActionResult Delete([FromRoute] int pageId, [FromRoute] int bulletPointId) { BulletPointService bulletPointService; try { bulletPointService = new BulletPointService(Settings.GetSection("AppSettings").GetSection("DefaultConnectionString").Value); bulletPointService.DeleteBulletPointForPage(pageId, bulletPointId, false); } catch (Exception e) { return(BadRequest(e)); } return(Ok()); }
public IActionResult GetBulletPointsForPage([FromRoute] int pageId) { BulletPointService bulletPointService; List <BulletPoint> bulletPointList; try { bulletPointService = new BulletPointService(Settings.GetSection("AppSettings").GetSection("DefaultConnectionString").Value); bulletPointList = bulletPointService.GetAllBulletPointsForPage(pageId); } catch (Exception e) { return(BadRequest(e)); } if (bulletPointList.Count == 0) { return(NoContent()); } return(Ok(bulletPointList)); }