refactor: change PinByHash to take hash in byte form
This commit is contained in:
parent
a76d13e75d
commit
1812b9cd38
|
@ -2,6 +2,7 @@ package account
|
|||
|
||||
import (
|
||||
"crypto/ed25519"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
|
@ -280,9 +281,10 @@ func (s AccountServiceDefault) DeletePinByHash(hash string, userId uint) error {
|
|||
|
||||
return nil
|
||||
}
|
||||
func (s AccountServiceDefault) PinByHash(hash string, userId uint) error {
|
||||
func (s AccountServiceDefault) PinByHash(hash []byte, userId uint) error {
|
||||
hashStr := hex.EncodeToString(hash)
|
||||
// Define a struct for the query condition
|
||||
uploadQuery := models.Upload{Hash: hash}
|
||||
uploadQuery := models.Upload{Hash: hashStr}
|
||||
|
||||
// Retrieve the upload ID for the given hash
|
||||
var uploadID uint
|
||||
|
|
Loading…
Reference in New Issue