Skip to content

Commit

Permalink
Fixed ratelimit issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kyrea committed Jan 4, 2024
1 parent 6e241a8 commit 7f565fd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/routes/v4/textUtilities/quote.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ router
* @returns {function} Express middleware function that handles rate limiting.
*
*/
.get(authorize(config.roles.USER), createRateLimiter(), getRandomQuote)
.get(createRateLimiter(), authorize(config.roles.USER), getRandomQuote)
/**
* @api {post} v4/quote Increment Quote Data
* @apiDescription Increment data related to quotes (only accessible by database moderators).
Expand All @@ -53,7 +53,7 @@ router
* @returns {function} Express middleware function that handles rate limiting.
*
*/
.post(authorize(config.roles.DB_MOD), createRateLimiter(), incrementData('Quote'));
.post(createRateLimiter(), authorize(config.roles.DB_MOD), incrementData('Quote'));

router
.route('/:id')
Expand All @@ -77,7 +77,7 @@ router
* @description Creates a rate limiter middleware to control the frequency of requests.
* @returns {function} Express middleware function that handles rate limiting.
*/
.patch(authorize(config.roles.DB_MOD), createRateLimiter(), updateData('Quote'))
.patch(createRateLimiter(), authorize(config.roles.DB_MOD), updateData('Quote'))
/**
* @api {delete} v4/quote/:id Delete Quote Data
* @apiDescription Delete data related to quotes with a specific ID (only accessible by admins).
Expand All @@ -98,7 +98,7 @@ router
* @description Creates a rate limiter middleware to control the frequency of requests.
* @returns {function} Express middleware function that handles rate limiting.
*/
.delete(authorize(config.roles.ADMIN), createRateLimiter(), deleteData('Quote'));
.delete(createRateLimiter(), authorize(config.roles.ADMIN), deleteData('Quote'));

// Export the router
export default router;

0 comments on commit 7f565fd

Please sign in to comment.