Skip to content

Commit

Permalink
Merge pull request #86 from YoungLeeHan/blog-display
Browse files Browse the repository at this point in the history
update: Api routes domain-dependently #53
  • Loading branch information
YoungSong99 authored Aug 11, 2023
2 parents 0a97404 + baf9231 commit d848d59
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions client/src/components/nav/AdminMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default function AdminMenu() {
<>
<div className="p-3 mt-2 mb-2 h4 bg-light">Admin Links</div>
<ul className="list-group list-unstyled">
<div className="p-1 pt-2"><h3>- Product Management</h3></div>
<div className="p-1 pt-2"><h5>- Product Management</h5></div>
<li>
<NavLink
className="list-group-item"
Expand All @@ -32,7 +32,7 @@ export default function AdminMenu() {
</NavLink>
</li>

<div className="p-1 pt-4"><h3>- Blog Management</h3></div>
<div className="p-1 pt-4"><h5>- Blog Management</h5></div>
<li>
<NavLink
className="list-group-item"
Expand Down
4 changes: 2 additions & 2 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ app.use("/api", authRoutes);
app.use("/api", categoryRoutes);
app.use("/api", ageCategoryRoutes);
app.use("/api", productRoutes);
app.use("/api/blog", blogCategoryRoutes);
app.use("/api/blog", blogPostRoutes);
app.use("/api", reviewRoutes);
app.use("/api", checkoutRoutes);
app.use("api", userOrderRoutes);
app.use("/api", blogCategoryRoutes);
app.use("/api", blogPostRoutes);
app.use("/auth", authGoogle);
app.use("/index", indexGoogle);

Expand Down
10 changes: 5 additions & 5 deletions server/routes/blogCategory.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import {
// productsByCategory,
} from "../controllers/blogCategory.js";

router.post("/blog/category", requireSignin, isAdmin, create);
router.put("/blog/category/:categoryId", requireSignin, isAdmin, update);
router.delete("/blog/category/:categoryId", requireSignin, isAdmin, remove);
router.get("/blog/categories", list);
router.get("/blog/category/:slug", read);
router.post("/category", requireSignin, isAdmin, create);
router.put("/category/:categoryId", requireSignin, isAdmin, update);
router.delete("/category/:categoryId", requireSignin, isAdmin, remove);
router.get("/categories", list);
router.get("/category/:slug", read);
// router.get("/products-by-category/:slug", productsByCategory);

export default router;
12 changes: 6 additions & 6 deletions server/routes/blogPost.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import { requireSignin, isAdmin } from "../middlewares/auth.js";
import {create, list, images, read, update, remove } from "../controllers/blog.js";

// routes
router.post("/blog/post-create", requireSignin, isAdmin, formidable(), create);
router.get("/blog/list", list);
router.get("/blog/:slug", read);
router.get("/blog/images/:postId", images);
router.delete("/blog/:postId", requireSignin, isAdmin, remove);
router.put("/blog/:postId", requireSignin, isAdmin, formidable(), update);
router.post("/post-create", requireSignin, isAdmin, formidable(), create);
router.get("/list", list);
router.get("/:slug", read);
router.get("/images/:postId", images);
router.delete("/:postId", requireSignin, isAdmin, remove);
router.put("/:postId", requireSignin, isAdmin, formidable(), update);



Expand Down

1 comment on commit d848d59

@vercel
Copy link

@vercel vercel bot commented on d848d59 Aug 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

youngleehan-client – ./client

youngleehan-client-git-main-youngleehan.vercel.app
youngleehan-client.vercel.app
youngleehan-client-youngleehan.vercel.app

Please sign in to comment.