mirror of
https://github.com/Such-Software/medusa-plugin-blog.git
synced 2026-10-25 05:48:38 +01:00
change api route for getting posts by category
This commit is contained in:
+1
-1
@@ -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)
|
||||
|
||||
@@ -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": [
|
||||
|
||||
Reference in New Issue
Block a user