Hey guys, I have a navigation wich is filled through an api request. As you can see I have a big property path in my return statement. Where I could filter this out before?
export const onGet = async () => {
const { data } = await supabase
.from("Pages")
.select(`WebsiteId(ConfigId(*))`)
.match({ WebsiteId: 9, URL: "/" })
.single();
return data;
};
export default component$(() => {
const navigation = useEndpoint();
return (
<Resource
value={navigation}
onPending={() => <div>Loading...</div>}
onRejected={() => <div>Error</div>}
onResolved={(nav) => (
<main>
<pre>
{JSON.stringify(nav.WebsiteId.ConfigId.Navigation, null, 2)}
</pre>
</main>
)}
/>
);