Skip to content

Commit e383f0c

Browse files
committed
Document how to keep the React API modules in sync
1 parent be0c29b commit e383f0c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

docs/en/framework/ui/react/http-requests.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,14 @@ const productsQuery = useQuery({
202202
})
203203
```
204204

205+
## Keeping API Modules in Sync
206+
207+
`abp generate-proxy` has no React target. Its `-t js` generator produces jQuery proxy scripts for MVC / Razor Pages applications, and it must run in a folder that contains a Web project file, so it does not apply to the React application. Update the modules under `src/lib/api/` yourself when a backend contract changes:
208+
209+
1. Start the backend and check the new contract on its Swagger UI or `/api/abp/api-definition?includeTypes=true`.
210+
2. Update the DTO interfaces and function signatures in the matching module.
211+
3. Update the callers and run `npm run build` so TypeScript reports the mismatches.
212+
205213
## Development Proxy
206214

207215
In development, Vite proxies `/api`, `/connect`, and `/getEnvConfig`. This lets the React app use same-origin paths while calls are forwarded to the backend, Auth Server, or gateway configured by `VITE_API_URL` and `VITE_AUTH_URL`.

0 commit comments

Comments
 (0)