From 9f00e02e74dcb4c9fa4100007c97667cc0a94b7c Mon Sep 17 00:00:00 2001 From: Danial Raza Date: Wed, 17 Jan 2024 22:48:11 +0100 Subject: [PATCH] refactor: rename getQuotesByCategory to getQuotesInCategory --- src/routes/index.ts | 4 ++-- src/routes/quotes/getQuotesByAuthor.ts | 2 +- .../quotes/{getQuotesByCategory.ts => getQuotesInCategory.ts} | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) rename src/routes/quotes/{getQuotesByCategory.ts => getQuotesInCategory.ts} (89%) diff --git a/src/routes/index.ts b/src/routes/index.ts index d30096f..6e62c44 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -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() @@ -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) diff --git a/src/routes/quotes/getQuotesByAuthor.ts b/src/routes/quotes/getQuotesByAuthor.ts index f7b3d36..7e69cfd 100644 --- a/src/routes/quotes/getQuotesByAuthor.ts +++ b/src/routes/quotes/getQuotesByAuthor.ts @@ -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 { diff --git a/src/routes/quotes/getQuotesByCategory.ts b/src/routes/quotes/getQuotesInCategory.ts similarity index 89% rename from src/routes/quotes/getQuotesByCategory.ts rename to src/routes/quotes/getQuotesInCategory.ts index 08f4fde..e890234 100644 --- a/src/routes/quotes/getQuotesByCategory.ts +++ b/src/routes/quotes/getQuotesInCategory.ts @@ -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()