mirror of
https://github.com/System-End/site.git
synced 2026-04-19 22:05:11 +00:00
15 lines
412 B
JavaScript
15 lines
412 B
JavaScript
export default async function getConsoles(req, res) {
|
|
let data = await fetch(
|
|
'https://airbridge.hackclub.com/v0.1/Sprig%20Waitlist/Requests'
|
|
).then(r => r.json())
|
|
|
|
function check(val) {
|
|
return val == 'Pending' || val == 'Approved'
|
|
}
|
|
|
|
const consoleCount = data
|
|
? data.filter(console => check(console.fields.Status)).length
|
|
: 100 // arbitrary fallback number
|
|
|
|
res.json(consoleCount)
|
|
}
|