refactor: have PinByHash use PinByID

This commit is contained in:
Derrick Hammer 2024-01-17 17:19:46 -05:00
parent 310c23b95e
commit 6545faad6a
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 1 additions and 11 deletions

View File

@ -172,17 +172,7 @@ func (s AccountServiceImpl) PinByHash(hash string, accountID uint) error {
return result.Error return result.Error
} }
// Create a pin with the retrieved upload ID and matching account ID return s.PinByID(uploadID, accountID)
pinQuery := models.Pin{UploadID: uploadID, UserID: accountID}
result = s.portal.Database().
Where(&pinQuery).
First(&models.Pin{})
if result.Error != nil {
return result.Error
}
return nil
} }
func (s AccountServiceImpl) PinByID(uploadId uint, accountID uint) error { func (s AccountServiceImpl) PinByID(uploadId uint, accountID uint) error {