refactor: change PinByHash to take hash in byte form

This commit is contained in:
Derrick Hammer 2024-02-16 21:57:20 -05:00
parent a76d13e75d
commit 1812b9cd38
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 2 deletions

View File

@ -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