I need some help finding the best way to separate the data below by type:
data: [
{ name: 'discounts_offers', type: 'EMAIL', consent: true },
{ name: 'newsletter', type: 'EMAIL', consent: true },
{ name: 'product_upgrade', type: 'EMAIL', consent: true },
{ name: 'sms_offer', type: 'SMS', consent: true },
{ name: 'post_offer', type: 'POST', consent: true }
]
I have a component inside a page which loops through the list above:
<CommunicationPreference
v-for="(communication, index) in communicationPreferences"
:key="index"
:communication="communication"
/>
But I actually need to create two sections with headings and depending on the communication type then loop through, like the image attached:
