I have the following response from my database as part of a larger dataset. How would one filter this to only include the offers where type (which is an enum) === 'product'?
I have gone round and round and can't seem to find the best way to create a variable with only the product offers.
[[{'id':1,'created_at':1678757095682,'name':'Monthly Legacy Card','description':'','type':'action','product_id':0,'duration':0,'_product':[]}],[{'id':3,'created_at':1678757295097,'name':'10% Discount','description':'','type':'discount','product_id':0,'duration':0,'_product':[]}],[{'id':2,'created_at':1678757212295,'name':'Digital Download ','description':'','type':'coupon','product_id':0,'duration':0,'_product':[]}],[{'id':4,'created_at':1678773932876,'name':'One Month Humanity Magazine','description':'','type':'product','product_id':2,'duration':1,'_product':[{'id':2,'created_at':1678757891298,'name':'Humanity Magazine','price':9.99,'code':'MAG-HUMANITY','category_id':2,'main_image':{'path':'/vault/T8h5_tNd/9NekvK2JWrcSmewJRhtelZOyX6w/r_L2VQ../IHL_Mockup.png','name':'IHL_Mockup.png','type':'image','size':345168,'mime':'image/png','meta':{'width':581,'height':395},'url':'https://x8ki-letl-twmt.n7.xano.io/vault/T8h5_tNd/9NekvK2JWrcSmewJRhtelZOyX6w/r_L2VQ../IHL_Mockup.png'}}]}]]