fix: remove rows effected check
This commit is contained in:
parent
9e35c614e3
commit
445084ca5b
|
@ -77,7 +77,7 @@ func (m *MetadataServiceDefault) SaveUpload(ctx context.Context, metadata Upload
|
|||
ret := m.db.WithContext(ctx).Model(&models.Upload{}).Where(&upload).First(&upload)
|
||||
|
||||
if ret.Error != nil {
|
||||
if errors.Is(ret.Error, gorm.ErrRecordNotFound) && ret.RowsAffected > 0 {
|
||||
if errors.Is(ret.Error, gorm.ErrRecordNotFound) {
|
||||
return m.createUpload(ctx, metadata)
|
||||
}
|
||||
return ret.Error
|
||||
|
|
Loading…
Reference in New Issue