mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Task filtering
This commit is contained in:
parent
997e58455d
commit
bba6d6623b
@ -150,6 +150,19 @@ class TaskFilters extends QueryFilters
|
|||||||
return $this->builder->orderBy($sort_col[0], $dir);
|
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
|
public function task_status(string $value = ''): Builder
|
||||||
{
|
{
|
||||||
if (strlen($value) == 0) {
|
if (strlen($value) == 0) {
|
||||||
|
@ -48,7 +48,11 @@ trait SubscriptionHooker
|
|||||||
RequestOptions::JSON => ['body' => $body], RequestOptions::ALLOW_REDIRECTS => false,
|
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) {
|
} catch (ClientException $e) {
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user