unknownCores.map(async (coreSerial, index) => { const coreId = cores.docs.find((core) => core.serial === coreSerial); if (coreId && coreId.id) { await got.patch(`${SPACEX_API}/cores/${coreId.id}`, { json: { details: unknownStatus[parseInt(index, 10)], status: 'unknown', }, headers: { 'spacex-key': KEY, }, }); } })
render() { let clazz = this.state.collapse ? 'fa fa-minus-square-o' : 'fa fa-plus-square-o'; return ( <span className='repl-cljs-docs-fold'> { <span className='repl-cljs-doc-list'> <i className={clazz} onClick={this.onToggleCollapse}></i> <span className='cm-atom title'>Documentation Viewer</span> {this.state.collapse ? this.props.docs : null} </span> } </span> ); }
rawLaunches.docs.filter((doc) => doc.upcoming === false)
landpads.docs.map(async (landpad) => { const launchIds = launches.docs.filter((launch) => { if (launch.cores.filter((c) => c.landpad === landpad.id).length > 0) { return true; } return false; }).map((launch) => launch.id); await got.patch(`${SPACEX_API}/landpads/${landpad.id}`, { json: { launches: launchIds, }, headers: { 'spacex-key': KEY, }, }); results.landpad = true; })
payloads.docs.map(async (payload) => { const launchId = _.find(launches.docs, (launch) => launch.payloads.includes(payload.id)); if (launchId && launchId.id) { await got.patch(`${SPACEX_API}/payloads/${payload.id}`, { json: { launch: launchId.id, }, headers: { 'spacex-key': KEY, }, }); results.payload = true; } })
ships.docs.map(async (ship) => { const launchIds = launches.docs.filter((launch) => { if (launch.ships.includes(ship.id)) { return true; } return false; }).map((launch) => launch.id); await got.patch(`${SPACEX_API}/ships/${ship.id}`, { json: { launches: launchIds, }, headers: { 'spacex-key': KEY, }, }); results.ship = true; })
launchpads.docs.map(async (launchpad) => { const launchIds = launches.docs.filter((launch) => { if (launch.launchpad === launchpad.id) { return true; } return false; }).map((launch) => launch.id); await got.patch(`${SPACEX_API}/launchpads/${launchpad.id}`, { json: { launches: launchIds, }, headers: { 'spacex-key': KEY, }, }); results.launchpad = true; })
crewMembers.docs.map(async (crew) => { const launchIds = launches.docs.filter((launch) => { if (launch.crew.includes(crew.id)) { return true; } return false; }).map((launch) => launch.id); await got.patch(`${SPACEX_API}/crew/${crew.id}`, { json: { launches: launchIds, }, headers: { 'spacex-key': KEY, }, }); results.crew = true; })
cores.docs.map(async (core) => { const launchIds = launches.docs.filter((launch) => { if (launch.cores.filter((c) => c.core === core.id).length > 0) { return true; } return false; }).map((launch) => launch.id); await got.patch(`${SPACEX_API}/cores/${core.id}`, { json: { launches: launchIds, }, headers: { 'spacex-key': KEY, }, }); results.core = true; })
activeCores.map(async (coreSerial, index) => { const coreId = cores.docs.find((core) => core.serial === coreSerial); if (coreId && coreId.id) { await got.patch(`${SPACEX_API}/cores/${coreId.id}`, { json: { details: activeStatus[parseInt(index, 10)], status: 'active', }, headers: { 'spacex-key': KEY, }, }); } })
inactiveCores.map(async (coreSerial, index) => { const coreId = cores.docs.find((core) => core.serial === coreSerial); if (coreId && coreId.id) { await got.patch(`${SPACEX_API}/cores/${coreId.id}`, { json: { details: inactiveStatus[parseInt(index, 10)], status: 'inactive', }, headers: { 'spacex-key': KEY, }, }); } })
rawLaunches.docs.filter((doc) => doc.upcoming === true)