From ee3c42a17f23c6db1ac832cc099901bccd7ea24a Mon Sep 17 00:00:00 2001 From: Gabriel Santana de Menezes Date: Thu, 21 May 2026 19:07:31 -0400 Subject: [PATCH 1/2] fix: remove Content-Type header when sending FormData in apiFetch The hardcoded 'Content-Type: application/json' header was conflicting with multipart/form-data uploads. When body is FormData, we now omit the Content-Type header to let the browser set the correct 'multipart/form-data; boundary=...' header. Fixes 415 Unsupported Media Type error on photo uploads. Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/lib/api.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index a656413..c25d7e3 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -21,16 +21,17 @@ export async function apiFetch(path: string, options: RequestOptions = {}) { } } + const isFormData = body instanceof FormData + const contentTypeHeader = isFormData ? {} : { 'Content-Type': 'application/json' } + const response = await fetch(buildUrl(path), { ...rest, headers: { - 'Content-Type': 'application/json', + ...contentTypeHeader, ...authHeader, ...headers, }, - body: body !== undefined && body !== null && !(body instanceof FormData) - ? JSON.stringify(body) - : body, + body: isFormData ? body : (body !== undefined && body !== null ? JSON.stringify(body) : undefined), }) const text = await response.text() From 39ed29c0c45eae696e3b987a960bfbb62b96cbf7 Mon Sep 17 00:00:00 2001 From: Gabriel Santana de Menezes Date: Thu, 21 May 2026 19:10:35 -0400 Subject: [PATCH 2/2] docs: add PR size limits to CLAUDE.md Enforce maximum 5 files and 30 lines changed per PR to keep reviews focused and maintainable. Split by layer (frontend, backend, config) when exceeding limits. Co-Authored-By: Claude Sonnet 4.6 --- CLAUDE.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index 3bef874..7793a93 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -125,6 +125,19 @@ The authenticated email comes from `securityIdentity.getPrincipal().getName()` a This ensures code review, clear history, and traceability. +### PR Size Limits + +To keep PRs focused and reviewable, enforce these limits **per PR**: +- **Maximum 5 files changed** +- **Maximum 30 lines changed** (added, modified, or deleted combined) + +**If exceeding these limits:** Split into multiple PRs. **Prefer splitting by layer:** +- One PR for backend changes (`backend/`) +- One PR for frontend changes (`frontend/`) +- One PR for config/infra (`docker-compose.yml`, `.env`, etc.) + +This keeps code review focused, reduces merge conflicts, and makes history easier to bisect. + ## Skills Skills do projeto em `.claude/skills/`: