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 (
|
import (
|
||||||
"crypto/ed25519"
|
"crypto/ed25519"
|
||||||
|
"encoding/hex"
|
||||||
"errors"
|
"errors"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -280,9 +281,10 @@ func (s AccountServiceDefault) DeletePinByHash(hash string, userId uint) error {
|
||||||
|
|
||||||
return nil
|
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
|
// 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
|
// Retrieve the upload ID for the given hash
|
||||||
var uploadID uint
|
var uploadID uint
|
||||||
|
|
Loading…
Reference in New Issue