aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/item/controller.go
diff options
context:
space:
mode:
Diffstat (limited to 'item/controller.go')
-rw-r--r--item/controller.go71
1 files changed, 0 insertions, 71 deletions
diff --git a/item/controller.go b/item/controller.go
index bb2eb94..b68f2aa 100644
--- a/item/controller.go
+++ b/item/controller.go
@@ -24,77 +24,6 @@ import (
"strconv"
)
-func handleGetBrandItems (ctx *gin.Context) {
- id, err := strconv.ParseUint(ctx.Param("id"), 10, 64)
- if err != nil {
- ctx.Error(e.ErrInvalidID)
- return
- }
-
- var items []SavedItem
- err = getBrandItems(&items, uint(id))
- if err != nil {
- ctx.Error(err)
- ctx.Abort()
- return
- }
-
- ctx.JSON(http.StatusOK, gin.H{
- "data": items,
- })
-}
-
-func handleGetBrands (ctx *gin.Context) {
- var brands []Brand
-
- err := getBrands(&brands)
- if err != nil {
- ctx.Error(err)
- ctx.Abort()
- return
- }
-
- ctx.JSON(http.StatusOK, gin.H{
- "data": brands,
- })
-}
-
-func handleSaveBrand (ctx *gin.Context) {
- var brand Brand
- ctx.Bind(&brand)
-
- err := brand.upsert()
- if err != nil {
- ctx.Error(err)
- ctx.Abort()
- return
- }
-
- ctx.JSON(http.StatusOK, gin.H{
- "data": brand,
- })
-}
-
-func handleDelBrand (ctx *gin.Context) {
- id, err := strconv.ParseUint(ctx.Param("id"), 10, 64)
- if err != nil {
- ctx.Error(e.ErrInvalidID)
- return
- }
-
- var brand Brand
- brand.ID = uint(id)
-
- err = brand.del()
- if err != nil {
- ctx.Error(err)
- ctx.Abort()
- return
- }
-
- ctx.JSON(http.StatusOK, nil)
-}
-
func handleGetItems (ctx *gin.Context) {
var items []SavedItem