diff --git a/server/AyaNova/Controllers/TagController.cs b/server/AyaNova/Controllers/TagController.cs index 14980069..08ad7554 100644 --- a/server/AyaNova/Controllers/TagController.cs +++ b/server/AyaNova/Controllers/TagController.cs @@ -74,7 +74,7 @@ namespace AyaNova.Api.Controllers /// - /// Bulk add tags to objects + /// Bulk add tags to list of object id's specified /// /// Required /// Required @@ -92,6 +92,24 @@ namespace AyaNova.Api.Controllers return Ok(ApiOkResponse.Response(await TagUtil.BulkAdd(ayaType, tag, idList, ct), true)); } + /// + /// Bulk add tags to all objects of type specified + /// + /// Required + /// Required + /// Number of items affected + [HttpPost("bulk-add-any/{ayaType}/{tag}")] + public async Task 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)); + } + diff --git a/server/AyaNova/biz/TagUtil.cs b/server/AyaNova/biz/TagUtil.cs index 3dc4cfe1..b31c5c62 100644 --- a/server/AyaNova/biz/TagUtil.cs +++ b/server/AyaNova/biz/TagUtil.cs @@ -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 BulkAddAny(AyaType ayaType, string tag, AyContext ct) + { + throw new System.NotImplementedException("NOT IMPLEMENTED YET"); + } }//eoc