From 42a6a00b1d24f29acb494698977844d73d922ff8 Mon Sep 17 00:00:00 2001 From: product-trustedstack Date: Fri, 26 Apr 2024 15:18:17 +0530 Subject: [PATCH] make getting media type steps lean. --- adapters/trustedstack/trustedstack.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/adapters/trustedstack/trustedstack.go b/adapters/trustedstack/trustedstack.go index 43dc49b0ea0..f79f43ffe35 100644 --- a/adapters/trustedstack/trustedstack.go +++ b/adapters/trustedstack/trustedstack.go @@ -9,7 +9,6 @@ import ( "github.com/prebid/openrtb/v20/openrtb2" "github.com/prebid/prebid-server/v2/adapters" "github.com/prebid/prebid-server/v2/config" - "github.com/prebid/prebid-server/v2/errortypes" "github.com/prebid/prebid-server/v2/openrtb_ext" ) @@ -57,7 +56,7 @@ func (a *adapter) MakeBids(internalRequest *openrtb2.BidRequest, externalRequest for _, sb := range bidResp.SeatBid { for i := range sb.Bid { - bidType, err := getMediaTypeForImp(&sb.Bid[i], internalRequest.Imp) + bidType, err := getBidMediaTypeFromMtype(&sb.Bid[i]) if err != nil { errs = append(errs, err) } else { @@ -80,16 +79,6 @@ func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server co }, nil } -func getMediaTypeForImp(bid *openrtb2.Bid, imps []openrtb2.Imp) (openrtb_ext.BidType, error) { - mediaType, err := getBidMediaTypeFromMtype(bid) - if err != nil { - return "", &errortypes.BadInput{ - Message: err.Error(), - } - } - return mediaType, nil -} - func getBidMediaTypeFromMtype(bid *openrtb2.Bid) (openrtb_ext.BidType, error) { switch bid.MType { case openrtb2.MarkupBanner: