This commit is contained in:
@@ -84,7 +84,7 @@ namespace AyaNova.Api.Controllers
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get TagGroup pick list
|
||||
/// Get TagGroup pick list, list of tag groups with name and ID
|
||||
///
|
||||
/// Required roles: AnyRole
|
||||
///
|
||||
@@ -126,6 +126,39 @@ namespace AyaNova.Api.Controllers
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get Tag pick list from group
|
||||
/// Required roles: AnyRole
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="id">TagGroupId</param>
|
||||
/// <returns>name value list of all tags in group</returns>
|
||||
[HttpGet("TagsInGroupPickList")]
|
||||
public async Task<IActionResult> TagsInGroupPickList([FromRoute] long id)
|
||||
{
|
||||
if (!serverState.IsOpen)
|
||||
{
|
||||
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
|
||||
}
|
||||
|
||||
if (!Authorized.IsAuthorizedToReadFullRecord(HttpContext.Items, AyaType.TagGroup))//Note: anyone can read a tag-group, but that might change in future so keeping this code in
|
||||
{
|
||||
return StatusCode(401, new ApiNotAuthorizedResponse());
|
||||
}
|
||||
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return BadRequest(new ApiErrorResponse(ModelState));
|
||||
}
|
||||
|
||||
//Instantiate the business object handler
|
||||
TagGroupBiz biz = new TagGroupBiz(ct, UserIdFromContext.Id(HttpContext.Items), UserRolesFromContext.Roles(HttpContext.Items));
|
||||
|
||||
var l = await biz.GetTagsInGroupPickListAsync(id);
|
||||
return Ok(new ApiOkResponse(l));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Post TagGroup
|
||||
///
|
||||
|
||||
@@ -142,6 +142,22 @@ namespace AyaNova.Biz
|
||||
}
|
||||
|
||||
|
||||
//get picklist (simple non-paged)
|
||||
internal async Task<List<NameIdItem>> GetTagsInGroupPickListAsync(long tagGroupId)
|
||||
{
|
||||
TODO: change this to return a name value list of tags in group
|
||||
List<NameIdItem> l = new List<NameIdItem>();
|
||||
l = await ct.Locale
|
||||
.OrderBy(m => m.Name)
|
||||
.Select(m => new NameIdItem()
|
||||
{
|
||||
Id = m.Id,
|
||||
Name = m.Name
|
||||
}).ToListAsync();
|
||||
|
||||
return l;
|
||||
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//UPDATE
|
||||
|
||||
@@ -11,6 +11,14 @@ namespace raven_integration
|
||||
public class TagGroupOps
|
||||
{
|
||||
|
||||
//OPS
|
||||
//CREATE A GROUP
|
||||
//TAG A WIDGET WITH A GROUP OF TAGS
|
||||
//GET A PICKLIST OF ALL TAGS IN A GROUP??
|
||||
//GET A ID ONLY LIST OF ALL TAG ID's IN A GROUP
|
||||
//DELETE A GROUP
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test taggroup
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user