From 73b1e5746a3f074aa103b5914a02769ff057c56e Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Thu, 16 Jun 2022 22:36:03 +0200 Subject: fix: Pass entry as reference It was not getting the object created by gorm so `.ID` was 0 causing all sort of weird iterations. That is also cause by the lack of testes. That will also be fixed in the next commits. --- controller/controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'controller/controller.go') diff --git a/controller/controller.go b/controller/controller.go index 7cbee6a..7fc8748 100644 --- a/controller/controller.go +++ b/controller/controller.go @@ -38,7 +38,7 @@ func (e *Env) UpdateEntry(c *gin.Context) { func (e *Env) CreateEntry(c *gin.Context) { var entry db.Entry c.ShouldBind(&entry) - e.Entries.Create(entry) + e.Entries.Create(&entry) e.Worker.SpawnWorker(entry.ID, entry.Link, entry.OutputFolder) c.Redirect(http.StatusFound, "/") } -- cgit v1.2.3