This commit is contained in:
2020-05-16 14:26:03 +00:00
parent 4ef776cf1e
commit 4b4a4ad5cf
2 changed files with 24 additions and 2 deletions

View File

@@ -74,7 +74,7 @@ namespace AyaNova.Api.Controllers
/// <summary>
/// Bulk add tags to objects
/// Bulk add tags to list of object id's specified
/// </summary>
/// <param name="ayaType">Required</param>
/// <param name="tag">Required</param>
@@ -92,6 +92,24 @@ namespace AyaNova.Api.Controllers
return Ok(ApiOkResponse.Response(await TagUtil.BulkAdd(ayaType, tag, idList, ct), true));
}
/// <summary>
/// Bulk add tags to all objects of type specified
/// </summary>
/// <param name="ayaType">Required</param>
/// <param name="tag">Required</param>
/// <returns>Number of items affected</returns>
[HttpPost("bulk-add-any/{ayaType}/{tag}")]
public async Task<IActionResult> BulkAddAny([FromRoute] AyaType ayaType, [FromRoute] string tag)
{
if (!serverState.IsOpen)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
if (!ModelState.IsValid)
return BadRequest(new ApiErrorResponse(ModelState));
if (!Authorized.HasModifyRole(HttpContext.Items, ayaType))
return StatusCode(403, new ApiNotAuthorizedResponse());
return Ok(ApiOkResponse.Response(await TagUtil.BulkAddAny(ayaType, tag, ct), true));
}

View File

@@ -219,10 +219,14 @@ namespace AyaNova.Biz
{
//todo iterate the object in question, open and update and save each one through it's biz object interface so rules etc are all maintained
//not sure if should update locked or read only objects, probably not I guess as it should only do whatever was done in interface
//hmm... tomorrow problem
throw new System.NotImplementedException("NOT IMPLEMENTED YET");
}
public static async Task<long> BulkAddAny(AyaType ayaType, string tag, AyContext ct)
{
throw new System.NotImplementedException("NOT IMPLEMENTED YET");
}
}//eoc