将加入查询字符串参数添加到资源
我正在使用“ ra-data-treeql”的React-Admin(我正在使用“ Php-crud-api”)。
我设定 const dataProvider = treeqlprovider('https://www.apiurl.xyz/');
,然后
const app =()=> (< admin dataProvider = {dataProvider}>< resource name =“ sellers” list = {sellerList}/><</admin> ,
带有来自API的“简单”资源要加入不同的表(例如,邮递员的部分URL是卖家?join = brands& join = products)。 如何在资源名称中添加加入参数?如果我使用 <资源名称=“卖家?join = brands& join = products” list = {sellerList} /> 我收到一个错误。
谢谢大家
I'm using React-Admin with "ra-data-treeql" (I'm using "php-crud-api").
I setconst dataProvider = treeqlProvider('https://www.apiurl.xyz/');
and then
const App = () => ( <Admin dataProvider={dataProvider}> <Resource name="sellers"list={sellerList} /> </Admin>
With a "simple" resource from API all works fine but I need to join different tables (for example the partial URL in postman is sellers?join=brands&join=products).
How can I add the join parameters in Resource name? If I use
<Resource name="sellers?join=brands&join=products"list={sellerList} />
I receive an error.
Thanks everybody
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从我在这里看到的问题是,错误是在查询字符串中发送两次“加入”:一次相等的产品和第二次平等品牌,这使API调用混淆。
但是实际上,我不想将其作为部分路径发送到另一个组件。
因此,我希望仅将参数发送到资源组件,并且在所有操作的情况下(例如:制作查询字符串)。
然后,您可以将其称为您想要的地方:
From what i'm seeing here the error is by sending "join" two times in the query string : one time equal products and second time equal brands which confuses the api call.
But actually I wouldn't like to send this as partial path to another component.
So i would prefer to send only parameters to Resource component and there should everything operated (e.g: making query string).
Then you can call it where you want like this :