Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ProcessMaker/Http/Controllers/Api/TaskController.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private function processExecutionRaw(): ProcessExecutionRawRepository
public function index(Request $request, $getTotal = false, User $user = null)
{
if (config('app.processmaker_optimized_tasks_enabled')) {
return (new V1_1TaskController())->indexOptimized($request, $getTotal, $user);
return app(V1_1TaskController::class)->indexOptimized($request, $getTotal, $user);
}
// If a specific user is specified, use it; otherwise use the authorized user
// This is necessary to produce accurate counts for Saved Searches
Expand Down
9 changes: 9 additions & 0 deletions tests/Feature/Api/TaskControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,15 @@ public function testTasksByCaseReturnsCorrectData()
$this->assertEquals($data2['form_text_area_1'], $responseData[1]['taskData']['form_text_area_1']);
}

public function testIndexResolvesOptimizedV11ControllerFromContainer()
{
config(['app.processmaker_optimized_tasks_enabled' => true]);

$response = $this->apiCall('GET', '/tasks');

$response->assertOk();
}

public function testShowTaskIncludesNewProperty()
{
$user = User::factory()->create();
Expand Down
Loading