submissions: wrong query
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Quaternions 2024-12-17 16:30:42 -08:00
parent 298a68fa97
commit 3a6dd311bf

View File

@ -26,7 +26,7 @@ func (env *ScriptPolicy) Get(ctx context.Context, id int64) (model.ScriptPolicy,
func (env *ScriptPolicy) GetFromHash(ctx context.Context, hash uint64) (model.ScriptPolicy, error) { func (env *ScriptPolicy) GetFromHash(ctx context.Context, hash uint64) (model.ScriptPolicy, error) {
var mdl model.ScriptPolicy var mdl model.ScriptPolicy
if err := env.db.Model(&model.ScriptPolicy{}).Where("hash = ?", hash).Error; err != nil { if err := env.db.Take(&mdl,"from_script_hash = ?", hash).Error; err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) { if errors.Is(err, gorm.ErrRecordNotFound) {
return mdl, datastore.ErrNotExist return mdl, datastore.ErrNotExist
} }