aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-07-17 01:11:20 -0400
committerLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-07-17 01:11:20 -0400
commit861a1666e48a91d43db6d1fd272dac832013f5b7 (patch)
tree21806783d2ce48536ae5505e0d5b147514031ef5
parentc7b29fa19510daf4e766b689c7bc105742f35119 (diff)
downloaddonetick-861a1666e48a91d43db6d1fd272dac832013f5b7.tar.gz
donetick-861a1666e48a91d43db6d1fd272dac832013f5b7.tar.bz2
donetick-861a1666e48a91d43db6d1fd272dac832013f5b7.zip
Remove unnecessary code in skipChore and completeChore functions
-rw-r--r--internal/chore/handler.go9
1 files 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{