React doctor#1
Conversation
…ts and improved layout
…charts in dashboard
…nd refactor API endpoint documentation.
…idate status formatting types
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65d845375d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const response = await api | ||
| .delete(`batches/warehouses/${warehouseId}/products/${deleteProduct.id}/batches`) | ||
| .json<DeleteBatchesResponse>(); | ||
| await api.delete(`products/${deleteProduct.id}`).json(); |
There was a problem hiding this comment.
Keep deletion scoped to the selected warehouse
This model builds its list from warehouses/{warehouseId}/products, so the delete action is operating in a warehouse-scoped inventory view; switching executeDelete to DELETE products/{id} makes a single-warehouse action soft-delete the product globally across all warehouses. In multi-warehouse tenants, deleting from Warehouse A would unexpectedly remove the product from Warehouse B as well, which is a data-scope regression from the prior warehouse-specific batch-delete flow.
Useful? React with 👍 / 👎.
|
@codex make the code review of the last commit, i fix the changes that you requested |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 818b539d29
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| // Sort | ||
| const sorted = [...filtered].sort((a, b) => { | ||
| const sorted = filtered.toSorted((a, b) => { |
There was a problem hiding this comment.
Replace toSorted with ES2017-compatible sorting
Using filtered.toSorted(...) introduces a runtime dependency on Array.prototype.toSorted, which is not available in ES2017-era browsers and is not automatically polyfilled by TypeScript/Next.js. Since this hook runs on the client, users on older engines will hit TypeError: filtered.toSorted is not a function and the page will fail to render; keep immutable sorting with [...] .sort(...) (and apply the same fix to other new toSorted usages in this commit).
Useful? React with 👍 / 👎.
No description provided.