fix: remove PinByHash logic

This commit is contained in:
Derrick Hammer 2024-03-28 18:31:40 -04:00
parent d810cf0848
commit cb6ba5a24b
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 0 additions and 11 deletions

View File

@ -1178,23 +1178,12 @@ func (s *S5API) accountPinStatus(jc jape.Context) {
return
}
userID := middleware.GetUserFromContext(jc.Request.Context())
decodedCid, err := encoding.CIDFromString(cid)
if err != nil {
s.sendErrorResponse(jc, NewS5Error(ErrKeyInvalidOperation, err))
return
}
if err := s.accounts.PinByHash(decodedCid.Hash.HashBytes(), userID); err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
s.sendErrorResponse(jc, NewS5Error(ErrKeyResourceNotFound, err))
return
}
s.sendErrorResponse(jc, NewS5Error(ErrKeyInternalError, err))
return
}
meta, err := s._import.GetImport(jc.Request.Context(), decodedCid.Hash.HashBytes())
if err != nil {