verbal-limeV
Refine2y ago
23 replies
verbal-lime

How can i use query params for fetching?

I have this code:

import { NumberField, Show, TextField } from "@refinedev/antd"; import { useShow } from "@refinedev/core"; import { Typography } from "antd"; const { Title } = Typography; interface IProduct { store_id: number; name: string; postalcode: number; } export const StoreShow = () => { const { queryResult } = useShow<IProduct>({ }); const { data, isLoading } = queryResult; const record = data?.data; return ( <Show isLoading={isLoading}> <Title level={5}>{"ID"}</Title> <NumberField value={record?.store_id ?? ""} /> <Title level={5}>{"Title"}</Title> <TextField value={record?.name} /> </Show> ); };

Its making the request to localhost/stores/4 (being 4 an exmaple id) when it should be localhost/searchstore?store_id=4
Was this page helpful?