#Cache Problem with Table

5 messages · Page 1 of 1 (latest)

outer island
#

I got a Server client that fetches the data from Supabase and provides it to a AG-Grid table.
When I navigate through couple of the pages somehow it's showing old data in the table. When I refresh the data is good again but after navigating it's gone.
Here is my server component and my supabase api call:
`
'use server';

import 'ag-grid-community/styles/ag-grid.css'; // Mandatory CSS required by the Data Grid
import 'ag-grid-community/styles/ag-theme-quartz.css'; // Optional Theme applied to the Data Grid
import useSupabase from '~/core/hooks/use-supabase';
import { PageBody } from '~/core/ui/Page';
import Button from '~/core/ui/Button';
import {
Cog6ToothIcon,
InformationCircleIcon,
} from '@heroicons/react/24/outline';

import { Checkbox } from '~/core/ui/Checkbox';

import AppHeader from '../components/AppHeader';
import { ScanDMCModal } from './components/ScanDMCModal';
import { getAssets } from '~/lib/assets/database/queries';
import AssetTable from './components/AssetTable';
import NewAssetButton from './components/NewAssetButton';

async function AssetOverviewPage() {
const client = useSupabase();
const {data, error} = await getAssets(client);
return (
<>
<PageBody>
<div className="mx-5">
{
data && data.length === 0 ? <div>No data available</div> :
<AssetTable data={data!} />
}
</div>
</PageBody>
</>
);
}

export async function getAssets(client: Client) {
const result = await client
.from('asset')
.select<
string,
AssetData
>(
,asset_status:fk_status_id (),asset_category:fk_category_id (),storage_location:fk_storage_location_id (, storage_warehouse:fk_warehouse_id ()),order_line:fk_order_line_id (, order_header:fk_order_header_id ()), item:fk_item_id ()`
)
.neq('fk_status_id', '08ff3a91-b931-4156-a63f-4c6811b6e588')
.throwOnError();
return result

ornate mulchBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

outer island
north drumBOT
# outer island I got a Server client that fetches the data from Supabase and provides it to a A...
Please use code blocks

When sharing code or error messages, please use code blocks.
You can create a code block by wrapping your code in three backticks (`), like this: ```
code here

You can also specify the language in the code block (e.g. ts, js) to enable syntax highlighting:  ```ts
export default function Page(){}

Link a Gist to upload entire files: https://gist.github.com/
Link a Code Sandbox to share runnable examples: https://codesandbox.io/s
Link a Code Sandbox to an existing GitHub repo: https://codesandbox.io/s/github/<username>/<reponame>

tall iris
#

Show how you are trying to revalidate @outer island

Also which version of nextjs are you on