api-platform / api-platform/create-client

React generator has inconsistent paths generation

Aberta
#376 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
TypeScript
Estrelas
376
Forks
132
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

**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

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.