submissions: fix operations CountSince

This commit is contained in:
Quaternions 2025-04-05 12:34:27 -07:00
parent 5d259e20f2
commit 566a84183a
Signed by: Quaternions
GPG Key ID: D0DF5964F79AC131

@ -56,7 +56,7 @@ func (env *Operations) Delete(ctx context.Context, id int32) error {
func (env *Operations) CountSince(ctx context.Context, owner int64, since int64) (int64, error) {
var count int64
if err := env.db.Where("owner = ? AND created_at > ?",owner,since).Count(&count).Error; err != nil {
if err := env.db.Model(&model.Operation{}).Where("owner = ? AND created_at > ?",owner,since).Count(&count).Error; err != nil {
return count, err
}