23 lines
439 B
Go
23 lines
439 B
Go
|
package cart
|
||
|
|
||
|
import (
|
||
|
"github.com/gin-gonic/gin"
|
||
|
"relynolli-server/handlers/cart/endpoints"
|
||
|
)
|
||
|
|
||
|
func HandleRoutes(parent *gin.RouterGroup) {
|
||
|
h := endpoints.GetHandlers()
|
||
|
cart := parent.Group("/cart")
|
||
|
itemRouter := cart.Group("/item")
|
||
|
{
|
||
|
cart.GET("", h.GetCartItems)
|
||
|
cart.POST("", h.CreateFUser)
|
||
|
}
|
||
|
|
||
|
{
|
||
|
itemRouter.POST("", h.CreateCartItem)
|
||
|
itemRouter.PATCH("", h.UpdateCartItem)
|
||
|
itemRouter.DELETE("", h.DeleteCartItem)
|
||
|
}
|
||
|
}
|