From 60df6b9d8da21883da932f0cc41c8a962eee6923 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 21 Apr 2018 21:54:05 +1000 Subject: [PATCH] Actions for Tasks/Products (#2045) * balances dump * balances dump * balances dump * apply actions to tasks * cast type boolean --- app/Http/Controllers/TaskApiController.php | 3 +++ app/Ninja/Transformers/ProductTransformer.php | 1 + 2 files changed, 4 insertions(+) diff --git a/app/Http/Controllers/TaskApiController.php b/app/Http/Controllers/TaskApiController.php index 6fd08074f4..117c9bc632 100644 --- a/app/Http/Controllers/TaskApiController.php +++ b/app/Http/Controllers/TaskApiController.php @@ -149,6 +149,9 @@ class TaskApiController extends BaseAPIController */ public function update(UpdateTaskRequest $request) { + if ($request->action) { + return $this->handleAction($request); + } $task = $request->entity(); diff --git a/app/Ninja/Transformers/ProductTransformer.php b/app/Ninja/Transformers/ProductTransformer.php index 707bc628ec..453f663310 100644 --- a/app/Ninja/Transformers/ProductTransformer.php +++ b/app/Ninja/Transformers/ProductTransformer.php @@ -34,6 +34,7 @@ class ProductTransformer extends EntityTransformer 'archived_at' => $this->getTimestamp($product->deleted_at), 'custom_value1' => $product->custom_value1, 'custom_value2' => $product->custom_value2, + 'is_deleted' => (bool) $product->is_deleted, ]); } }