fix: remove rows effected check

This commit is contained in:
Derrick Hammer 2024-02-17 23:42:32 -05:00
parent 9e35c614e3
commit 445084ca5b
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 1 additions and 1 deletions

View File

@ -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