import { component$, useSignal, useVisibleTask$ } from "@builder.io/qwik"; import type { DocumentHead } from "@builder.io/qwik-city"; import ky from "ky"; import { OAUTH_LINK } from "~/lib/constants"; export default component$(() => { const files = useSignal([]); useVisibleTask$(async () => { const res: any[] | undefined = await ky.get("/api/list", { headers: { Authorization: `Bearer ${localStorage.getItem("token")}` } }) .json(); console.log(res); files.value = res!; }) return ( <> oauth {files.value.map((file) => (

Owner: {file.Owner}

File ID: {file.ID}

Created: {new Date(file.CreatedAt).toLocaleString()}

))} ); }); export const head: DocumentHead = { title: "Welcome to Qwik", meta: [ { name: "description", content: "Qwik site description", }, ], };