Zanoryt
Zanoryt
Explore posts from servers
KKinde
Created by Zanoryt on 1/9/2024 in #💻┃support
Search for user via provided_id via API?
On a backend microservice, I would like to be able to iterate my users table and pull down latest data in order to cache the user profile details with the most recent and update my table. To do this most effectively, I would need to be able to hit /api/v1/users with the provided_id matching the UUID from my users table. How can this be done?
24 replies
SSolidJS
Created by Zanoryt on 8/12/2023 in #support
Now using createResource(), the content never loads.
const getReports = async () => {
return (await fetch('/api/reports')).json();
};

export default function Home() {
const [reports, { refetch }] = createResource(getReports);
...snip...

<Show when={!reports.loading} fallback={<tr><td>Loading...</td></tr>}>
<For each={reports()}>{item => (
<tr>
...snip...
</tr>
)}</For>
</Show>
...snip...
};
const getReports = async () => {
return (await fetch('/api/reports')).json();
};

export default function Home() {
const [reports, { refetch }] = createResource(getReports);
...snip...

<Show when={!reports.loading} fallback={<tr><td>Loading...</td></tr>}>
<For each={reports()}>{item => (
<tr>
...snip...
</tr>
)}</For>
</Show>
...snip...
};
All I ever see is Loading... in the rendering. I'm using SSR with Cloudflare Pages.
11 replies
SSolidJS
Created by Zanoryt on 7/22/2023 in #support
What's the best way to create multiple layouts that only some routes use?
I need to have multiple layouts. I'd like some pages to use different layouts, rather than a single universal layout.
2 replies
SSolidJS
Created by Zanoryt on 7/22/2023 in #support
How can I access a store from the parent context from inside of a nested context?
I am trying to access the WebsocketContext from inside of the DataStreamContext, in order to send out a websocket message when a DataStreamContext function is called. I can't seem to figure out the right way to do this. Provider structure:
<Html lang="en">
<Head>
<Title>Airframes</Title>
<Meta charset="utf-8" />
<Meta name="viewport" content="width=device-width, initial-scale=1" />
</Head>
<Body>
<Suspense>
<ErrorBoundary>
<WebsocketProvider>
<DataStreamProvider>
<Routes>
<FileRoutes />
</Routes>
</DataStreamProvider>
</WebsocketProvider>
</ErrorBoundary>
</Suspense>
<Scripts />
</Body>
</Html>
<Html lang="en">
<Head>
<Title>Airframes</Title>
<Meta charset="utf-8" />
<Meta name="viewport" content="width=device-width, initial-scale=1" />
</Head>
<Body>
<Suspense>
<ErrorBoundary>
<WebsocketProvider>
<DataStreamProvider>
<Routes>
<FileRoutes />
</Routes>
</DataStreamProvider>
</WebsocketProvider>
</ErrorBoundary>
</Suspense>
<Scripts />
</Body>
</Html>
38 replies