2021-10-18 15:32:20 +00:00
|
|
|
import { api_call } from "./util";
|
|
|
|
|
2021-10-19 07:47:51 +00:00
|
|
|
const planetes = document.getElementById("resultats");
|
|
|
|
|
2021-10-18 15:32:20 +00:00
|
|
|
console.log('planet.js loaded');
|
|
|
|
|
|
|
|
api_call("planets", console.log);
|
|
|
|
|
|
|
|
|
2021-10-19 07:47:51 +00:00
|
|
|
function remplissage(prout){
|
|
|
|
console.log(prout.results[0]);
|
|
|
|
|
|
|
|
api_call("films/1", (response) => {
|
|
|
|
console.log(response);
|
|
|
|
});
|
|
|
|
|
|
|
|
planetes.innerHTML =
|
|
|
|
`<section class="resultat">
|
|
|
|
<h1 class="titreAccordeon"></h1>
|
|
|
|
<div class="accordeon">
|
|
|
|
<div class="1">Prout 1</div>
|
|
|
|
<div class="2">Prout 2</div>
|
|
|
|
<div class="3">Prout 3</div>
|
|
|
|
</div>
|
|
|
|
</section>`;
|
|
|
|
}
|
|
|
|
|
|
|
|
api_call("planets", remplissage);
|