From 861a1666e48a91d43db6d1fd272dac832013f5b7 Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Wed, 17 Jul 2024 01:11:20 -0400 Subject: [PATCH] Remove unnecessary code in skipChore and completeChore functions --- internal/chore/handler.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/internal/chore/handler.go b/internal/chore/handler.go index 5ec8cdd..0067940 100644 --- a/internal/chore/handler.go +++ b/internal/chore/handler.go @@ -683,12 +683,7 @@ func (h *Handler) skipChore(c *gin.Context) { }) return } - if err := h.choreRepo.UpsertChore(c, chore); err != nil { - c.JSON(500, gin.H{ - "error": "Error skipping chore", - }) - return - } + c.JSON(200, gin.H{ "res": chore, }) @@ -861,7 +856,7 @@ func (h *Handler) completeChore(c *gin.Context) { return } go func() { - h.notifier.SendChoreCompletion(c, chore, []*uModel.User{currentUser}) + h.notifier.SendChoreCompletion(c, chore, currentUser) h.nPlanner.GenerateNotifications(c, updatedChore) }() c.JSON(200, gin.H{