refactor: use errors.Is

This commit is contained in:
Derrick Hammer 2024-02-18 03:24:06 -05:00
parent a77981f0a6
commit ca289818a9
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 1 additions and 1 deletions

View File

@ -299,7 +299,7 @@ func (s AccountServiceDefault) PinByHash(hash []byte, userId uint) error {
func (s AccountServiceDefault) PinByID(uploadId uint, userId uint) error {
result := s.db.Model(&models.Pin{}).Where(&models.Pin{UploadID: uploadId, UserID: userId}).First(&models.Pin{})
if result.Error != nil && result.Error != gorm.ErrRecordNotFound {
if result.Error != nil && !errors.Is(result.Error, gorm.ErrRecordNotFound) {
return result.Error
}