mirror of
https://github.com/grocy/grocy.git
synced 2026-04-07 05:16:15 +02:00
Use FilteredApiResponse for current chores
This commit is contained in:
parent
076e8df7d3
commit
30516e472b
|
|
@ -58,7 +58,7 @@ class ChoresApiController extends BaseApiController
|
|||
|
||||
public function Current(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
return $this->ApiResponse($response, $this->getChoresService()->GetCurrent());
|
||||
return $this->FilteredApiResponse($response, $this->getChoresService()->GetCurrent(), $request->getQueryParams());
|
||||
}
|
||||
|
||||
public function TrackChoreExecution(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
|
|
|
|||
|
|
@ -13,3 +13,7 @@ SELECT id,
|
|||
END
|
||||
) AS display_name
|
||||
FROM users;
|
||||
CREATE VIEW uihelper_chores_current AS
|
||||
SELECT chores_current.*, chores.name AS chore_name
|
||||
from chores_current
|
||||
join chores on chores_current.chore_id = chores.id;
|
||||
|
|
|
|||
|
|
@ -152,8 +152,7 @@ class ChoresService extends BaseService
|
|||
|
||||
public function GetCurrent()
|
||||
{
|
||||
$sql = 'SELECT chores_current.*, chores.name AS chore_name from chores_current join chores on chores_current.chore_id = chores.id';
|
||||
return $this->getDatabaseService()->ExecuteDbQuery($sql)->fetchAll(\PDO::FETCH_OBJ);
|
||||
return $this->getDatabase()->uihelper_chores_current();
|
||||
}
|
||||
|
||||
public function TrackChore(int $choreId, string $trackedTime, $doneBy = GROCY_USER_ID)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user