From a893f522263a2fcf4284b63c53759419083ad644 Mon Sep 17 00:00:00 2001 From: CollinBeczak Date: Mon, 14 Oct 2024 13:16:32 -0500 Subject: [PATCH] change 'reset -> update' task bundling naming convention --- .../framework/controller/TaskBundleController.scala | 6 +++--- .../framework/repository/TaskBundleRepository.scala | 4 ++-- .../maproulette/framework/service/TaskBundleService.scala | 6 +++--- conf/v2_route/bundle.api | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/org/maproulette/framework/controller/TaskBundleController.scala b/app/org/maproulette/framework/controller/TaskBundleController.scala index 52221010..2838e997 100644 --- a/app/org/maproulette/framework/controller/TaskBundleController.scala +++ b/app/org/maproulette/framework/controller/TaskBundleController.scala @@ -262,17 +262,17 @@ class TaskBundleController @Inject() ( } /** - * Resets the bundle to the tasks provided, and unlock all tasks removed from current bundle + * Sets the bundle to the tasks provided, and unlock all tasks removed from current bundle * * @param bundleId The id of the bundle * @param taskIds The task ids the bundle will reset to */ - def resetTaskBundle( + def updateTaskBundle( id: Long, taskIds: List[Long] ): Action[AnyContent] = Action.async { implicit request => this.sessionManager.authenticatedRequest { implicit user => - this.serviceManager.taskBundle.resetTaskBundle(user, id, taskIds) + this.serviceManager.taskBundle.updateTaskBundle(user, id, taskIds) Ok(Json.toJson(this.serviceManager.taskBundle.getTaskBundle(user, id))) } } diff --git a/app/org/maproulette/framework/repository/TaskBundleRepository.scala b/app/org/maproulette/framework/repository/TaskBundleRepository.scala index 1e322d7c..264c132e 100644 --- a/app/org/maproulette/framework/repository/TaskBundleRepository.scala +++ b/app/org/maproulette/framework/repository/TaskBundleRepository.scala @@ -112,12 +112,12 @@ class TaskBundleRepository @Inject() ( } /** - * Resets the bundle to the tasks provided, and unlock all tasks removed from current bundle + * Sets the bundle to the tasks provided, and unlock all tasks removed from current bundle * * @param bundleId The id of the bundle * @param taskIds The task ids the bundle will reset to */ - def resetTaskBundle( + def updateTaskBundle( user: User, bundleId: Long, taskIds: List[Long] diff --git a/app/org/maproulette/framework/service/TaskBundleService.scala b/app/org/maproulette/framework/service/TaskBundleService.scala index 318a6c54..0f17c2ed 100644 --- a/app/org/maproulette/framework/service/TaskBundleService.scala +++ b/app/org/maproulette/framework/service/TaskBundleService.scala @@ -90,12 +90,12 @@ class TaskBundleService @Inject() ( } /** - * Resets the bundle to the tasks provided, and unlock all tasks removed from current bundle + * Sets the bundle to the tasks provided, and unlock all tasks removed from current bundle * * @param bundleId The id of the bundle * @param taskIds The task ids the bundle will reset to */ - def resetTaskBundle( + def updateTaskBundle( user: User, bundleId: Long, taskIds: List[Long] @@ -108,7 +108,7 @@ class TaskBundleService @Inject() ( ) } - this.repository.resetTaskBundle(user, bundleId, taskIds) + this.repository.updateTaskBundle(user, bundleId, taskIds) this.getTaskBundle(user, bundleId) } diff --git a/conf/v2_route/bundle.api b/conf/v2_route/bundle.api index 567afd2d..e5ea5ada 100644 --- a/conf/v2_route/bundle.api +++ b/conf/v2_route/bundle.api @@ -47,8 +47,8 @@ POST /taskBundle @org.maproulette.framework.c POST /taskBundle/:id @org.maproulette.framework.controller.TaskBundleController.getTaskBundle(id:Long, lockTasks:Boolean ?= false) ### # tags: [ Bundle ] -# summary: Resets a Task Bundle -# description: Resets the bundle to the tasks provided, and unlock all tasks removed from current bundle +# summary: Updates a Task Bundle +# description: Sets the bundle to the tasks provided, and unlock all tasks removed from current bundle # responses: # '200': # description: Ok with empty body @@ -63,7 +63,7 @@ POST /taskBundle/:id @org.maproulette.framework. # in: query # description: The task ids the bundle will reset to ### -POST /taskBundle/:id/reset @org.maproulette.framework.controller.TaskBundleController.resetTaskBundle(id: Long, taskIds: List[Long]) +POST /taskBundle/:id/update @org.maproulette.framework.controller.TaskBundleController.updateTaskBundle(id: Long, taskIds: List[Long]) ### # tags: [ Bundle ] # summary: Deletes a Task Bundle