@@ -183,6 +183,55 @@ public function index(Request $request)
183183 * ),
184184 * ),
185185 * )
186+ *
187+ * @OA\Post(
188+ * path="/users_task_count",
189+ * summary="Returns all users and their total tasks (POST version for large form_data)",
190+ * operationId="postUsersTaskCount",
191+ * tags={"Users"},
192+ * @OA\RequestBody(
193+ * description="Request body for filtering users",
194+ * @OA\JsonContent(
195+ * @OA\Property(
196+ * property="filter",
197+ * type="string",
198+ * description="Filter results by string. Searches First Name, Last Name, Email, or Username."
199+ * ),
200+ * @OA\Property(
201+ * property="include_ids",
202+ * type="string",
203+ * description="Comma separated list of user IDs to include in the response. Eg. 1,2,3"
204+ * ),
205+ * @OA\Property(
206+ * property="assignable_for_task_id",
207+ * type="integer",
208+ * description="Task ID to get assignable users for"
209+ * ),
210+ * @OA\Property(
211+ * property="form_data",
212+ * type="object",
213+ * description="Form data used to evaluate rule expressions for task assignment"
214+ * ),
215+ * ),
216+ * ),
217+ * @OA\Response(
218+ * response=200,
219+ * description="List of users with task counts",
220+ * @OA\JsonContent(
221+ * type="object",
222+ * @OA\Property(
223+ * property="data",
224+ * type="array",
225+ * @OA\Items(ref="#/components/schemas/users"),
226+ * ),
227+ * @OA\Property(
228+ * property="meta",
229+ * type="object",
230+ * ref="#/components/schemas/metadata",
231+ * ),
232+ * ),
233+ * ),
234+ * )
186235 */
187236 public function getUsersTaskCount (Request $ request )
188237 {
@@ -204,10 +253,10 @@ public function getUsersTaskCount(Request $request)
204253 $ include_ids = explode (', ' , $ include_ids_string );
205254 } elseif ($ request ->has ('assignable_for_task_id ' )) {
206255 $ processRequestToken = ProcessRequestToken::findOrFail ($ request ->input ('assignable_for_task_id ' ));
207- $ assignmentRule = $ processRequestToken ->getAssignmentRule ();
208256 if (config ('app.reassign_restrict_to_assignable_users ' )) {
209257 $ include_ids = $ processRequestToken ->process ->getAssignableUsersByAssignmentType ($ processRequestToken );
210258 }
259+ $ assignmentRule = $ processRequestToken ->getAssignmentRule ();
211260 if ($ assignmentRule === 'rule_expression ' && $ request ->has ('form_data ' )) {
212261 $ include_ids = $ processRequestToken ->getAssigneesFromExpression ($ request ->input ('form_data ' ));
213262 }
@@ -223,7 +272,8 @@ public function getUsersTaskCount(Request $request)
223272 ->withCount ('activeTasks ' )
224273 ->orderBy (
225274 $ request ->input ('order_by ' , 'username ' ),
226- $ request ->input ('order_direction ' , 'ASC ' ))
275+ $ request ->input ('order_direction ' , 'ASC ' )
276+ )
227277 ->paginate (50 );
228278
229279 return new ApiCollection ($ response );
@@ -359,8 +409,8 @@ public function getPinnnedControls(User $user)
359409 $ meta = $ user ->meta ? (array ) $ user ->meta : [];
360410
361411 return array_key_exists ('pinnedControls ' , $ meta )
362- ? $ meta ['pinnedControls ' ]
363- : [];
412+ ? $ meta ['pinnedControls ' ]
413+ : [];
364414 }
365415
366416 /**
@@ -774,10 +824,12 @@ private function uploadAvatar(User $user, Request $request)
774824 // Validate image content
775825 if ($ type === 'svg ' ) {
776826 // For SVG files, validate against XSS
777- if (preg_match ('/<script/i ' , $ data ) ||
827+ if (
828+ preg_match ('/<script/i ' , $ data ) ||
778829 preg_match ('/on\w+\s*=/i ' , $ data ) ||
779830 preg_match ('/javascript:/i ' , $ data ) ||
780- preg_match ('/data:/i ' , $ data )) {
831+ preg_match ('/data:/i ' , $ data )
832+ ) {
781833 throw new \Exception ('SVG contains potentially malicious content ' );
782834 }
783835 } else {
@@ -853,7 +905,7 @@ public function restore(Request $request)
853905 // Otherwise, search trashed users
854906 // for the user to restore
855907 $ user = User::onlyTrashed ()->where ($ input , $ request ->input ($ input ))
856- ->first ();
908+ ->first ();
857909 }
858910
859911 if ($ user instanceof User) {
0 commit comments