Skip to content

Commit

Permalink
Change template name and move into seperate directories
Browse files Browse the repository at this point in the history
  • Loading branch information
isakgranqvist2021 committed Apr 3, 2022
1 parent 110f8d8 commit f664ea7
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/packages/cart/cart.controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func ChangeQuantity(c *fiber.Ctx) error {
return c.Redirect("/cart")
}

func Checkout(c *fiber.Ctx) error {
func Cart(c *fiber.Ctx) error {
sess, err := config.GetStore().Get(c)

if err != nil {
Expand All @@ -80,7 +80,7 @@ func Checkout(c *fiber.Ctx) error {

products := JoinCart(cartInventory)

return c.Render("pages/checkout", fiber.Map{
return c.Render("pages/cart/index", fiber.Map{
"Products": products,
})
}
2 changes: 1 addition & 1 deletion src/packages/cart/cart.router.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cart
import "github.com/gofiber/fiber/v2"

func CartRouter(r fiber.Router) {
r.Get("/", Checkout)
r.Get("/", Cart)
r.Post("/add-to-cart/:ID", AddToCart)
r.Get("/change-quantity/:ACTION/:ID", ChangeQuantity)
}
2 changes: 1 addition & 1 deletion src/packages/order/order.controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func Success(c *fiber.Ctx) error {

fmt.Println(sess.Get("STRIPE_SESSION"))

return c.Render("pages/completed-purchase", nil)
return c.Render("pages/cart/success", nil)
}

func Pay(c *fiber.Ctx) error {
Expand Down
4 changes: 2 additions & 2 deletions src/packages/product/product.controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func ViewProduct(c *fiber.Ctx) error {
return c.Redirect("/error")
}

return c.Render("pages/view-product", fiber.Map{
return c.Render("pages/product/product", fiber.Map{
"Product": product,
})
}
Expand All @@ -31,7 +31,7 @@ func ViewProducts(c *fiber.Ctx) error {
return c.Redirect("/error")
}

return c.Render("pages/index", fiber.Map{
return c.Render("pages/product/index", fiber.Map{
"Products": products,
})
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit f664ea7

Please sign in to comment.