From bba6d6623b9b3056e6cbcbe5a36229106a650b9b Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 6 Apr 2024 10:07:54 +1100 Subject: [PATCH 1/2] Task filtering --- app/Filters/TaskFilters.php | 13 +++++++++++++ app/Utils/Traits/SubscriptionHooker.php | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app/Filters/TaskFilters.php b/app/Filters/TaskFilters.php index bae9ab882bb0..3356c538e08f 100644 --- a/app/Filters/TaskFilters.php +++ b/app/Filters/TaskFilters.php @@ -150,6 +150,19 @@ class TaskFilters extends QueryFilters return $this->builder->orderBy($sort_col[0], $dir); } + public function user_id(string $user = ''): Builder + { + if (strlen($user) == 0) { + return $this->builder; + } + + return $this->builder->where(function ($query) use ($user) { + $query->where('user_id', $this->decodePrimaryKey($user)) + ->orWhere('assigned_user_id', $this->decodePrimaryKey($user)); + }); + + } + public function task_status(string $value = ''): Builder { if (strlen($value) == 0) { diff --git a/app/Utils/Traits/SubscriptionHooker.php b/app/Utils/Traits/SubscriptionHooker.php index ee286a949423..fdacaca9dc26 100644 --- a/app/Utils/Traits/SubscriptionHooker.php +++ b/app/Utils/Traits/SubscriptionHooker.php @@ -48,7 +48,11 @@ trait SubscriptionHooker RequestOptions::JSON => ['body' => $body], RequestOptions::ALLOW_REDIRECTS => false, ]); - return array_merge($body, json_decode($response->getBody(), true)); + if($response_body = json_decode($response->getBody(), true)) + return array_merge($body, $response_body); + + return array_merge($body, ['message' => 'Success', 'status_code' => 200]); + } catch (ClientException $e) { $message = $e->getMessage(); From 99bb74a57a47b1f7330c2d9316d860d0dbae4b23 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 6 Apr 2024 10:08:16 +1100 Subject: [PATCH 2/2] v5.8.45 --- VERSION.txt | 2 +- config/ninja.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 36401c134be3..cd30fd94a6c7 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.8.44 \ No newline at end of file +5.8.45 \ No newline at end of file diff --git a/config/ninja.php b/config/ninja.php index 2272ae69c105..15efdb7d7f11 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -17,8 +17,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => env('APP_VERSION', '5.8.44'), - 'app_tag' => env('APP_TAG', '5.8.44'), + 'app_version' => env('APP_VERSION', '5.8.45'), + 'app_tag' => env('APP_TAG', '5.8.45'), 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', false),