feat: add PinByID
This commit is contained in:
parent
8ff09b5f02
commit
b56a8ba5ac
|
@ -184,3 +184,15 @@ func (s AccountServiceImpl) PinByHash(hash string, accountID uint) error {
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s AccountServiceImpl) PinByID(uploadId uint, accountID uint) error {
|
||||
// Create a pin with the retrieved upload ID and matching account ID
|
||||
pinQuery := models.Pin{UploadID: uploadId, UserID: accountID}
|
||||
result := s.portal.Database().Create(&pinQuery)
|
||||
|
||||
if result.Error != nil {
|
||||
return result.Error
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -13,4 +13,5 @@ type AccountService interface {
|
|||
AccountPins(id uint64, createdAfter uint64) ([]models.Pin, error)
|
||||
DeletePinByHash(hash string, accountID uint) error
|
||||
PinByHash(hash string, accountID uint) error
|
||||
PinByID(uploadId uint, accountID uint) error
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue