diff --git a/ProcessMaker/Http/Controllers/Api/UserController.php b/ProcessMaker/Http/Controllers/Api/UserController.php index 0ffb33450f..ec4eee61b7 100644 --- a/ProcessMaker/Http/Controllers/Api/UserController.php +++ b/ProcessMaker/Http/Controllers/Api/UserController.php @@ -183,6 +183,55 @@ public function index(Request $request) * ), * ), * ) + * + * @OA\Post( + * path="/users_task_count", + * summary="Returns all users and their total tasks (POST version for large form_data)", + * operationId="postUsersTaskCount", + * tags={"Users"}, + * @OA\RequestBody( + * description="Request body for filtering users", + * @OA\JsonContent( + * @OA\Property( + * property="filter", + * type="string", + * description="Filter results by string. Searches First Name, Last Name, Email, or Username." + * ), + * @OA\Property( + * property="include_ids", + * type="string", + * description="Comma separated list of user IDs to include in the response. Eg. 1,2,3" + * ), + * @OA\Property( + * property="assignable_for_task_id", + * type="integer", + * description="Task ID to get assignable users for" + * ), + * @OA\Property( + * property="form_data", + * type="object", + * description="Form data used to evaluate rule expressions for task assignment" + * ), + * ), + * ), + * @OA\Response( + * response=200, + * description="List of users with task counts", + * @OA\JsonContent( + * type="object", + * @OA\Property( + * property="data", + * type="array", + * @OA\Items(ref="#/components/schemas/users"), + * ), + * @OA\Property( + * property="meta", + * type="object", + * ref="#/components/schemas/metadata", + * ), + * ), + * ), + * ) */ public function getUsersTaskCount(Request $request) { @@ -223,7 +272,8 @@ public function getUsersTaskCount(Request $request) ->withCount('activeTasks') ->orderBy( $request->input('order_by', 'username'), - $request->input('order_direction', 'ASC')) + $request->input('order_direction', 'ASC') + ) ->paginate(50); return new ApiCollection($response); @@ -359,8 +409,8 @@ public function getPinnnedControls(User $user) $meta = $user->meta ? (array) $user->meta : []; return array_key_exists('pinnedControls', $meta) - ? $meta['pinnedControls'] - : []; + ? $meta['pinnedControls'] + : []; } /** @@ -774,10 +824,12 @@ private function uploadAvatar(User $user, Request $request) // Validate image content if ($type === 'svg') { // For SVG files, validate against XSS - if (preg_match('/