async function getCategoryIds ()
{
let response = axios.get( `${BASE_API_URL}categories?count=100` );
let catIds = response.data.map( c => c.id );
return _.samplesize( catIds, NUM_CATEGORIES )
};
This is my code I tried to change the data in [] but it still don't work
The main issue here is you have not used await in your code. adding await like the following should solve your problem -
let response = await axios.get( `${BASE_API_URL}categories?count=100` );