1818 * @apiGroup UserManagement
1919 * @apiPermission user
2020 *
21- * @apiHeader {String} Authorization User's access token.
21+ * @apiHeader {String} Key Internal access token
2222 *
2323 * @apiSuccess {Object} userDetails User's details.
2424 * @apiSuccess {String} userDetails.username User's username.
4848 * @apiGroup UserManagement
4949 * @apiPermission sudo
5050 *
51- * @apiHeader {String} Authorization User's access token.
51+ * @apiHeader {String} Key Internal access token
5252 *
5353 * @apiParam {String} id User's unique identifier.
5454 *
@@ -70,26 +70,31 @@ router
7070 */
7171 . get ( createRateLimiter ( ) , retrieveUserProfile )
7272 /**
73- * @api {patch } v4/user/profile/:id Get User Profile and Update reset the existing token
74- * @apiDescription Update the token for a specific user
75- * @apiName updateUserToken
73+ * @api {patch } v4/user/profile/:id Perform User Action (addquota, removequota, ban, unban, updatetoken)
74+ * @apiDescription Processes various user actions including adding/removing quota, banning/unbanning users, and updating user token.
75+ * @apiName processUserAction
7676 * @apiGroup UserManagement
7777 * @apiPermission sudo
7878 *
79- * @apiHeader {String} Authorization User's access token.
79+ * @apiHeader {String} Key Internal access token
8080 *
8181 * @apiParam {String} id User's unique identifier.
82- *
83- * @apiSuccess {Object} message
84- * @apiError (Unauthorized 401) Unauthorized Only authenticated users can access the data.
85- * @apiError (Forbidden 403) Forbidden Only authorized users can access the data.
86- * @apiError (Too Many Requests 429) TooManyRequests The client has exceeded the allowed number of requests within the time window.
87- * @apiError (Internal Server Error 500) InternalServerError An error occurred while processing the rate limit.
82+ * @apiParam {String} action Action to be performed (e.g., addquota, removequota, ban, unban, updatetoken).
83+ * @apiParam {String} [amount] Amount of quota to add or remove (required for addquota/removequota).
84+ * @apiParam {String} [reason] Reason for the action (required for ban, unban, and updatetoken).
85+ * @apiParam {String} [executor] Executor of the action (optional).
86+ * @apiParam {String} [expiry] Expiry of the ban (optional).
87+ *
88+ * @apiSuccess {Object} message Success message with details of the performed action.
89+ * @apiSuccess {Object} user Updated user data after the action.
90+ * @apiError (Unauthorized 401) Unauthorized Only authenticated users can perform actions.
91+ * @apiError (Forbidden 403) Forbidden Only authorized users can perform certain actions.
92+ * @apiError (Bad Request 400) BadRequest Invalid parameters for the specified action.
93+ * @apiError (Internal Server Error 500) InternalServerError An error occurred while processing the action.
8894 *
8995 * @api {function } createRateLimiter
9096 * @apiDescription Creates a rate limiter middleware to control the frequency of requests.
9197 * @apiSuccess {function} middleware Express middleware function that handles rate limiting.
92- *
9398 */
9499
95100 . patch ( createRateLimiter ( ) , processUserAction ) ;
0 commit comments