searchMosaicDefinitionArray requires it's first parameter to be an array of all the mosaics present under a namespace while searchMosaicDefinitionArray(res, ["eur"]) was sending the JSON data as a parameter which is incompatible with the helper function.
Thus, I changed searchMosaicDefinitionArray(res, ["eur"]) to searchMosaicDefinitionArray(res.data, ["eur"]).
searchMosaicDefinitionArray requires it's first parameter to be an array of all the mosaics present under a namespace while searchMosaicDefinitionArray(res, ["eur"]) was sending the JSON data as a parameter which is incompatible with the helper function. Thus, I changed searchMosaicDefinitionArray(res, ["eur"]) to searchMosaicDefinitionArray(res.data, ["eur"]).