summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/sparkles/controller.go4
-rw-r--r--app/controllers/sparkles/controller_test.go4
2 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/sparkles/controller.go b/app/controllers/sparkles/controller.go
index 061b5c6..bc388db 100644
--- a/app/controllers/sparkles/controller.go
+++ b/app/controllers/sparkles/controller.go
@@ -9,10 +9,10 @@ import (
)
type Controller struct {
- db db.Repository
+ db db.Repository[*domain.Sparkle]
}
-func New(db db.Repository) *Controller {
+func New(db db.Repository[*domain.Sparkle]) *Controller {
return &Controller{db: db}
}
diff --git a/app/controllers/sparkles/controller_test.go b/app/controllers/sparkles/controller_test.go
index 17bc338..99fdd69 100644
--- a/app/controllers/sparkles/controller_test.go
+++ b/app/controllers/sparkles/controller_test.go
@@ -15,7 +15,7 @@ import (
func TestSparkles(t *testing.T) {
t.Run("GET /sparkles", func(t *testing.T) {
sparkle, _ := domain.NewSparkle("@tanuki for helping me")
- store := db.NewRepository()
+ store := db.NewRepository[*domain.Sparkle]()
store.Save(sparkle)
mux := http.NewServeMux()
@@ -43,7 +43,7 @@ func TestSparkles(t *testing.T) {
t.Run("POST /sparkles", func(t *testing.T) {
t.Run("saves a new sparkle", func(t *testing.T) {
- repository := db.NewRepository()
+ repository := db.NewRepository[*domain.Sparkle]()
mux := http.NewServeMux()
controller := New(repository)
controller.MountTo(mux)