Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

ReferenceField not using custom data provider

未关闭
#504 4 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
42/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
react, typescript
领域
api, frontend

调研方向

首先跟踪通过 Hydra 数据提供程序发出的 ReferenceField 调用,并将其与 show 和 edit 页面使用的自定义数据提供程序进行比较。确认 ReferenceField 是否会触发两个数据提供程序;完成的标准是,其 API 请求使用自定义数据提供程序并包含身份验证标头,且不会产生未经身份验证的重复调用。

由索引模型根据 Issue 内容生成。

描述

Description
I've extended the Hydra data provider to add authenticatino headers.
My dataprovider adds auth headers to ALL api calls. I need to use supabase auth headers for the API authentication.
This works fine for all show/edit pages etc.

I'm expecting all components to use this data provider.

But when using ReferenceField in either show or create/edit pages, these custom headers are not passed to the calls.
After doing some debuggin with console.logs, it appears that this component does not even call the custom dataprovider, but the built in data provider. Therefore, all these components cause request errors because the API returns 401. The data does appear, so it seems to be doing multiple API calls. One with the custom data provider, and one without.

After checking with the ReactAdmin team, it turns out this is probably related to the default Hydra Data Provider.
Can this be checked?

Reference: https://github.com/marmelab/react-admin/issues/8883

主要语言
TypeScript
星标
516
派生
134
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

api-platform/admin 的其他 Issue

查看 api-platform/admin 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。