Skip to content

Commit

Permalink
Remove prints
Browse files Browse the repository at this point in the history
  • Loading branch information
isakgranqvist2021 committed Apr 5, 2022
1 parent 5809511 commit 5f9ae7e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 15 deletions.
3 changes: 0 additions & 3 deletions src/packages/cart/cart.helpers.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package cart

import (
"fmt"

"github.com/gofiber/fiber/v2"
"github.com/isakgranqvist2021/dropstore/src/packages/product"
"github.com/isakgranqvist2021/dropstore/src/services/store"
Expand Down Expand Up @@ -89,7 +87,6 @@ func JoinCart(cart []CartItem) []product.Product {
products, err := product.GetProducts()

if err != nil {
fmt.Printf("err -> %v\n", err)
return returnValue
}

Expand Down
6 changes: 0 additions & 6 deletions src/packages/product/product.controller.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package product

import (
"fmt"

"github.com/gofiber/fiber/v2"
"github.com/isakgranqvist2021/dropstore/src/services/database"
"github.com/isakgranqvist2021/dropstore/src/services/logger"
Expand Down Expand Up @@ -48,10 +46,6 @@ func ViewProducts(c *fiber.Ctx) error {
return c.Redirect("/error")
}

for _, v := range products {
fmt.Printf("%v\n\n", v)
}

return c.Render("pages/product/index", fiber.Map{
"Products": products,
})
Expand Down
4 changes: 2 additions & 2 deletions src/services/database/database.connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
var Client *mongo.Client = nil

func Disconnect() error {
fmt.Println("Disconnect")
fmt.Println("MongoDB has disconnected")

if err := Client.Disconnect(context.TODO()); err != nil {
go logger.Log(err)
Expand All @@ -25,7 +25,7 @@ func Disconnect() error {
}

func Connect() error {
fmt.Println("Connect")
fmt.Println("MongoDB has connected")

client, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(os.Getenv("MONGODB_URI")))

Expand Down
5 changes: 1 addition & 4 deletions src/services/database/database.update.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package database

import (
"context"
"fmt"

"go.mongodb.org/mongo-driver/bson/primitive"
)
Expand All @@ -22,13 +21,11 @@ func (options UpdateOptions) UpdateOneByID(ID *string) error {
return err
}

result, err := coll.UpdateByID(
_, err := coll.UpdateByID(
context.TODO(),
objectId,
options.Payload,
)

fmt.Println(result.ModifiedCount)

return err
}

0 comments on commit 5f9ae7e

Please sign in to comment.