From 6545faad6a55f96d30581588f97b6b22806de098 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 17 Jan 2024 17:19:46 -0500 Subject: [PATCH] refactor: have PinByHash use PinByID --- account/account.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/account/account.go b/account/account.go index 6e8b0fa..a55ee30 100644 --- a/account/account.go +++ b/account/account.go @@ -172,17 +172,7 @@ func (s AccountServiceImpl) PinByHash(hash string, accountID uint) error { return result.Error } - // Create a pin with the retrieved upload ID and matching account ID - 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 + return s.PinByID(uploadID, accountID) } func (s AccountServiceImpl) PinByID(uploadId uint, accountID uint) error {