api-platform / api-platform/create-client

React generator has inconsistent paths generation

未關閉
#376 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
376
分支
132
PR 合併指標
30 天內沒有已合併 PR

描述

**Description**
React generator has problem with paths for resources.
I generated a client using https://demo.api-platform.com/, while the generated routes have paths like `/admin/books/create` the Show components has paths like ``

**How to reproduce**

1. Generate a client with `rm -rf ./tmp && yarn build && ENTRYPOINT=https://demo.api-platform.com/ ./testgen.sh react`
2. Go to `tmp/react/routes/book.tsx` you will see

```js
const routes = [
} key="create" />,
} key="update" />,
} key="show" />,
} key="list" />,
} key="page" />,
];
```
3. Go to `tmp/react/components/book/Show.tsx` and you can see
```js

Back to list

```

![image](https://github.com/api-platform/create-client/assets/48998273/d930cc89-22c7-4e85-ae82-2f0ff9c06fe0)

**Possible Solution**
Use the same variable in all template when generating routes and links

**Additional Context**
PR here : https://github.com/api-platform/create-client/pull/377

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。