From 04520edca734aafc0c4530c32fb87d1a3b96c172 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 9 Dec 2024 21:23:33 -0800 Subject: [PATCH] fix IfStatusThenUpdate --- pkg/datastore/gormstore/submissions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/datastore/gormstore/submissions.go b/pkg/datastore/gormstore/submissions.go index 6e83b27..bfcee3f 100644 --- a/pkg/datastore/gormstore/submissions.go +++ b/pkg/datastore/gormstore/submissions.go @@ -53,7 +53,7 @@ func (env *Submissions) Update(ctx context.Context, id int64, values datastore.O // the update can only occur if the status matches one of the provided values. func (env *Submissions) IfStatusThenUpdate(ctx context.Context, id int64, statuses []model.Status, values datastore.OptionalMap) error { - if err := env.db.Model(&model.Submission{}).Where("id = ?", id).Where("status IN ?",statuses).Updates(values.Map()).Error; err != nil { + if err := env.db.Model(&model.Submission{}).Where("id = ?", id).Where("status_id IN ?",statuses).Updates(values.Map()).Error; err != nil { if err == gorm.ErrRecordNotFound { return datastore.ErrNotExist }