Is it possible to retrieve one of these items using the filter or find method to search for a match within the fiberAgrupations array?
I attempted the following:
const landlineRate = this.monolineJsonRates[0].cambioCaudal.getAll()
.filter(landlinedRates => landlinedRates["fiberAgrupations"].includes(this.myPackId));
myPackId is 3230 and can be found in the first object.
JSON:
[{
"id": "T300Mb2",
"idAdditionalImage": "",
"name": "300 Mb",
"sourceId": ["T300Mb2"],
"fiberAgrupations": ["3230","3232","3234","3235","3237","3239","3248","3250","2875","2877","3139","3140","3074","3075"],
"prices": [
{"id": "3149", "price": "34,95"},
{"id": "3156", "price": "39,95"},
],
"availableRates": ["T600Mb2", "T1Gb"]
},
{
"id": "T600Mb",
"idAdditionalImage": "",
"name": "600 Mb",
"sourceId": ["T600Mb"],
"fiberAgrupations": ["2989","2994","2982","2983","3090","3089","3093","3084","2875","2877","3139","3140","3074","3075"],
"prices": [
{"id": "3149", "price": "38,95"},
{"id": "3156", "price": "47,95"},
],
"availableRates": []
},
{
"id": "T600Mb2",
"idAdditionalImage": "",
"name": "600 Mb",
"sourceId": ["T600Mb2"],
"fiberAgrupations": ["3219","3220","3223","3224","3241","3244","3252","3255","2875","2877","3139","3140","3074","3075"],
"prices": [
{"id": "3149", "price": "38,95"},
{"id": "3156", "price": "43,95"},
],
"availableRates": ["T1Gb"]
}]