diff options
author | Mo Tarbin <mhed.t91@gmail.com> | 2024-07-06 03:15:56 -0400 |
---|---|---|
committer | Mo Tarbin <mhed.t91@gmail.com> | 2024-07-06 03:15:56 -0400 |
commit | 36f4717454f9da8dff013d0387882c6633662faa (patch) | |
tree | b67bb12eb0d14833660310bcb1401a6320616e92 /internal/chore/repo | |
parent | 45e18c8edd55e98712d5f175ecaaae86fde4d933 (diff) | |
download | donetick-36f4717454f9da8dff013d0387882c6633662faa.tar.gz donetick-36f4717454f9da8dff013d0387882c6633662faa.tar.bz2 donetick-36f4717454f9da8dff013d0387882c6633662faa.zip |
Group chore detail query by chore ID and last completed date
Diffstat (limited to 'internal/chore/repo')
-rw-r--r-- | internal/chore/repo/repository.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/chore/repo/repository.go b/internal/chore/repo/repository.go index 52fa4ab..51ebb2c 100644 --- a/internal/chore/repo/repository.go +++ b/internal/chore/repo/repository.go @@ -243,7 +243,7 @@ func (r *ChoreRepository) GetChoreDetailByID(c context.Context, choreID int, cir ) ) AS recent_history ON chores.id = recent_history.chore_id`). Where("chores.id = ? and chores.circle_id = ?", choreID, circleID). - Group("chores.id"). + Group("chores.id, recent_history.last_completed_date"). First(&choreDetail).Error; err != nil { return nil, err |