chore: Fix completion window check in completeChore function

Add Resource handler
This commit is contained in:
Mo Tarbin 2025-02-06 21:54:34 -05:00
parent 4c1b402137
commit 86c90a34ee
2 changed files with 1 additions and 15 deletions

View file

@ -998,7 +998,7 @@ func (h *Handler) completeChore(c *gin.Context) {
}
// confirm that the chore in completion window:
if chore.CompletionWindow != nil {
if completedDate.After(chore.NextDueDate.Add(time.Hour * time.Duration(*chore.CompletionWindow))) {
if completedDate.Before(chore.NextDueDate.Add(time.Hour * time.Duration(*chore.CompletionWindow))) {
c.JSON(400, gin.H{
"error": "Chore is out of completion window",
})