From 8724847d5a4176bf36115735f7de13f283569225 Mon Sep 17 00:00:00 2001 From: "Harrison (Harry) Cramer" <32515581+harrisoncramer@users.noreply.github.com> Date: Mon, 14 Aug 2023 21:34:54 -0400 Subject: [PATCH] Addresses issue with #20 (#30) --- cmd/update.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/cmd/update.go b/cmd/update.go index dd7c61d..9dfc30e 100644 --- a/cmd/update.go +++ b/cmd/update.go @@ -4,7 +4,6 @@ import ( "encoding/json" "errors" "io" - "log" "net/http" "github.com/xanzy/go-gitlab" @@ -42,12 +41,7 @@ func UpdateHandler(w http.ResponseWriter, r *http.Request) { return } - git, err := gitlab.NewClient(c.authToken) - if err != nil { - log.Fatalf("Failed to create client: %v", err) - } - - mr, res, err := git.MergeRequests.UpdateMergeRequest(c.projectId, c.mergeId, &gitlab.UpdateMergeRequestOptions{Description: &updateRequest.Description}) + mr, res, err := c.git.MergeRequests.UpdateMergeRequest(c.projectId, c.mergeId, &gitlab.UpdateMergeRequestOptions{Description: &updateRequest.Description}) if err != nil { c.handleError(w, err, "Could not edit merge request", http.StatusBadRequest)