aboutsummaryrefslogtreecommitdiff
path: root/server/frontend/src/Test.tsx
blob: 6eee2d69af0932e523f7621833f8adf04205a64f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import {A, createAsync} from "@solidjs/router";
import {client} from "./api.js";
import {For, Suspense} from "solid-js";

export default function Test() {
    let items = createAsync(() => client.GET("/item", {
        params: {
            query: {
                itemId: ['HYPERION', 'BAT_WAND']
            }
        }
    }))
    return <>
        Test page <A href={"/"}>Back to main</A>
        <hr/>
        <Suspense fallback={"Loading items..."}>
            <p>Here are all Items:</p>
            <For each={Object.entries(items()?.data || {})}>
                { ([id, name]) => <li><code>{id}</code>: {name}</li>}
            </For>
        </Suspense>
    </>
}