From 2b7e9ce0778e0e3e9dbe3ddc1ae5c4e1e3a0ef74 Mon Sep 17 00:00:00 2001 From: Lacey Pevey <7490308+pevey@users.noreply.github.com> Date: Tue, 16 May 2023 11:17:47 -0500 Subject: [PATCH] change api route for getting posts by category --- src/api/index.ts | 2 +- thunder-collection_Medusa Blog_postman.json | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index 08a61fc..61311c9 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -22,7 +22,7 @@ export default (rootDirectory: string): Router | Router[] => { }) // GET ALL BLOG POSTS BY CATEGORY - router.get("/store/blog/category-posts/:handle", cors(storeCorsOptions), async (req, res) => { + router.get("/store/blog/category/:handle/posts", cors(storeCorsOptions), async (req, res) => { const blogService = req.scope.resolve("blogService") blogService.getBlogPostsByCategoryHandle(req.params.handle).then((blog_posts) => { return res.json(blog_posts) diff --git a/thunder-collection_Medusa Blog_postman.json b/thunder-collection_Medusa Blog_postman.json index 50c73e2..b7df943 100644 --- a/thunder-collection_Medusa Blog_postman.json +++ b/thunder-collection_Medusa Blog_postman.json @@ -178,16 +178,17 @@ } }, { - "name": "Get Blog Category By Handle Copy", + "name": "Get Blog Posts By Category Handle", "request": { "method": "GET", "url": { - "raw": "http://localhost:9000/store/blog/category-posts/first-category", + "raw": "http://localhost:9000/store/blog/category/first-category/posts", "path": [ "store", "blog", - "category-posts", - "first-category" + "category", + "first-category", + "posts" ], "protocol": "http", "host": [