import {requestPVE, requestAPI} from "./utils.js"; window.addEventListener("DOMContentLoaded", init); async function init () { let resources = await requestAPI("/user/resources"); document.querySelector("main").innerHTML = buildTable(resources.resources, 1); } function buildTable (object, idx) { if (object instanceof Object) { let table = ""; if (idx === 1) { // topmost table gets some margin and a border table += `
${element} | ${buildTable(object[element], idx + 1)} |