You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried running this function but it's throwing an error.
Can Anyone please suggest us why this is happening or how else can we implement the same thing. I also tried using the request package which is getting executed perfectly but I am not able to get sessions from it.
it's showing .filter is not function.
var options = {
'method': 'GET',
'url': 'https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/calendarByPin?pincode=' + '201301' + '&date=' + DATE,
headers': {
'Accept-Language': 'en_US'
}
};
request(options, function (error, response) {
if (error) {
throw new Error(error);
}
let slots = JSON.parse(response.body);
console.log(slots.centers.length);
let sessions = slots.data.sessions;
let validSlots = sessions.filter(slot => slot.min_age_limit <= AGE && slot.available_capacity > 0)
console.log({ date: DATE, validSlots: validSlots.length })
});
The text was updated successfully, but these errors were encountered:
the Axios Config is not working it's throwing Error!
I tried running this function but it's throwing an error.
Can Anyone please suggest us why this is happening or how else can we implement the same thing. I also tried using the request package which is getting executed perfectly but I am not able to get sessions from it.
it's showing .filter is not function.
The text was updated successfully, but these errors were encountered: