Skip to content

Commit

Permalink
refactor: rename getQuotesByCategory to getQuotesInCategory
Browse files Browse the repository at this point in the history
  • Loading branch information
sdanialraza committed Jan 17, 2024
1 parent c4235f3 commit 9f00e02
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import createQuote from "./quotes/createQuote.js"
import getQuoteById from "./quotes/getQuoteById.js"
import getQuotes from "./quotes/getQuotes.js"
import getQuotesByAuthor from "./quotes/getQuotesByAuthor.js"
import getQuotesByCategory from "./quotes/getQuotesByCategory.js"
import getQuotesInCategory from "./quotes/getQuotesInCategory.js"
import getRandomQuote from "./quotes/getRandomQuote.js"

const router = Router()
Expand All @@ -16,7 +16,7 @@ router.get("/quotes", getQuotes)
router.get("/quotes/random", getRandomQuote)
router.get("/quotes/:id", getQuoteById)
router.get("/quotes/author/:author", getQuotesByAuthor)
router.get("/quotes/category/:category", getQuotesByCategory)
router.get("/quotes/category/:category", getQuotesInCategory)

router.post("/quotes", postRateLimit, createQuote)

Expand Down
2 changes: 1 addition & 1 deletion src/routes/quotes/getQuotesByAuthor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { database } from "../../index.js"
import { convertPropertiesFromDatabase } from "../../util/index.js"

/**
* Get all the quotes by their author.
* Get all the quotes by a specific author.
*/
export default async function getQuotesByAuthor(request: Request, response: Response) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { database } from "../../index.js"
import { convertPropertiesFromDatabase } from "../../util/index.js"

/**
* Get all the quotes by their category.
* Get all the quotes in a specific category.
*/
export default async function getQuotesByCategory(request: Request, response: Response) {
export default async function getQuotesInCategory(request: Request, response: Response) {
try {
const category = request.params.category.toLowerCase()

Expand Down

0 comments on commit 9f00e02

Please sign in to comment.