import { Admin, Resource } from 'react-admin';
// ... other imports
const userDataProvider = {
...customDataProvider(`${process.env.NEXT_PUBLIC_SERVER_URL}/api`),
getOne: (resource, params) => customDataProvider(`${process.env.NEXT_PUBLIC_SERVER_URL}/api`).getOne(resource, {
...params,
path: `custom-path-for-get-by-id/${params.id}`
})
};
const AdminsPage = () => {
// ... other code
return (
<Admin dataProvider={userDataProvider}>
// ... other resources
<Resource
name='user'
recordRepresentation='title'
list={UserList}
edit={UserEdit}
dataProvider={userDataProvider} // Use the custom data provider for the 'user' resource
/>
</Admin>
);
};
export default AdminsPage;