From cb6ba5a24b96047baead2f3e14143e5143535c0f Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 28 Mar 2024 18:31:40 -0400 Subject: [PATCH] fix: remove PinByHash logic --- api/s5/s5.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/api/s5/s5.go b/api/s5/s5.go index 4f85491..258071a 100644 --- a/api/s5/s5.go +++ b/api/s5/s5.go @@ -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 {