fix: remove PinByHash logic
This commit is contained in:
parent
d810cf0848
commit
cb6ba5a24b
11
api/s5/s5.go
11
api/s5/s5.go
|
@ -1178,23 +1178,12 @@ func (s *S5API) accountPinStatus(jc jape.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
userID := middleware.GetUserFromContext(jc.Request.Context())
|
|
||||||
|
|
||||||
decodedCid, err := encoding.CIDFromString(cid)
|
decodedCid, err := encoding.CIDFromString(cid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.sendErrorResponse(jc, NewS5Error(ErrKeyInvalidOperation, err))
|
s.sendErrorResponse(jc, NewS5Error(ErrKeyInvalidOperation, err))
|
||||||
return
|
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())
|
meta, err := s._import.GetImport(jc.Request.Context(), decodedCid.Hash.HashBytes())
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue