Skip to content

Bug fix and extends tracker's report endpoint#81

Merged
Nextraile merged 5 commits into
vercelfrom
agents/cors-issue-fix-cloudflare
Jun 17, 2026
Merged

Bug fix and extends tracker's report endpoint#81
Nextraile merged 5 commits into
vercelfrom
agents/cors-issue-fix-cloudflare

Conversation

@Nextraile

Copy link
Copy Markdown
Collaborator

This pull request introduces several improvements to the backend, improving API flexibility. The most important changes are grouped below:

Backend

  • Added support for requesting additional transaction fields (name, description) in tracker reports via the fields.transactions parameter, including validation and dynamic field selection in the response. [1] [2] [3]

Documentation and Testing

  • Updated the API collection documentation to demonstrate usage of the new fields[transactions] parameter for tracker reports.

Copilot AI review requested due to automatic review settings June 17, 2026 08:24
@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
my-finance Ready Ready Preview, Comment Jun 17, 2026 8:24am

@Nextraile Nextraile merged commit 0170a67 into vercel Jun 17, 2026
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the tracker reports API to optionally include additional transaction fields via fields[transactions], and also introduces frontend/backend CORS + API client adjustments to improve cross-origin/API consumption reliability.

Changes:

  • Backend: Add optional transaction fields (name, description) to tracker report responses based on fields[transactions], plus supporting request validation.
  • Frontend: Introduce a shared Axios apiClient and migrate a couple of calls to use it; add environment-specific Vite env files.
  • Docs: Update the trackers API collection and add a Cloudflare CORS configuration guide.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
Frontend/src/pages/access/Access.tsx Switch login request to use the shared apiClient instead of raw Axios + ApiUrl.
Frontend/src/loader/appLoader.ts Switch profile bootstrap calls to apiClient (centralized auth header handling).
Frontend/src/lib/api.ts Add centralized Axios client with baseURL + request interceptor for Bearer token.
Frontend/.env.production Add production Vite env values for API and storage endpoints.
Frontend/.env.dev Add dev Vite env values (note: filename/mode loading needs adjustment).
Frontend/.env Remove previous default env file.
Docs/collection/trackers_collection.yaml Document fields[transactions]=name,description usage for tracker reports.
CLOUDFLARE_CORS_FIX.md Add operational guide for Cloudflare CORS behavior/workarounds.
Backend/config/cors.php Expose all headers and enable supports_credentials.
Backend/app/Http/Requests/API/V1/Tracker/ShowTrackerReportRequest.php Add validation rules for fields.transactions.
Backend/app/Http/Controllers/API/V1/TrackerController.php Dynamically select transaction columns for reports and include optional fields in the response.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +28 to +29
'fields.transactions' => 'nullable',
'fields.transactions.*' => 'nullable|string|in:name,description',
Comment thread Frontend/.env.dev
Comment on lines +1 to +2
VITE_API_URL=http://localhost:8080/api/v1
VITE_STORAGE_API_URL=http://localhost:8080/api/v1/storage/ No newline at end of file
Comment thread CLOUDFLARE_CORS_FIX.md
| CORS works in localhost but not production | Check APP_DEBUG and CORS_ALLOWED_ORIGINS in .env |
| Preflight OPTIONS requests fail | Ensure your backend allows OPTIONS method (it does in Laravel) |
| Custom headers stripped | Disable Auto Minify and Rocket Loader |
| Credentials not sent | Frontend must use `withCredentials: true` (already fixed in our apiClient) |
Comment thread Frontend/src/lib/api.ts
Comment on lines +13 to +16
const token = localStorage.getItem('Authorization');
if (token) {
config.headers.Authorization = `Bearer ${token}`;
}
Comment thread Backend/config/cors.php
Comment on lines +9 to +11
'exposed_headers' => ['*'],
'max_age' => 3600,
'supports_credentials' => false,
'supports_credentials' => true,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants