Skip to content

fix: performance API docs status codes, period default, example dates; dashboard trend from zero - #152

Merged
sonpiaz merged 2 commits into
mainfrom
docs/performance-fixes
Oct 17, 2026
Merged

sonpiaz merged 2 commits into
mainfrom
docs/performance-fixes

Conversation

@sonpiaz

@sonpiaz sonpiaz commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

What changed

Follow-up to docs#151: three pre-existing mismatches on the performance API page, and the dashboard sentence about percentage change now that cms#510 sends no trend when the previous period was 0.

  • api-reference/performance.mdx
    • Errors: one 403 row (no session, not an active member, or no such program); the 401 and 404 rows are gone. The auth note says the same.
    • meta.period: "7d" when none is sent (was "all").
    • Example data rows are 2024-05-31 and 2024-06-01, inside meta.dateFrom/dateTo (one row was 2024-06-02, after dateTo). Totals unchanged.
  • brand/quickstart/view-performance.mdx: a metric that was 0 in the previous period shows no percentage.

Not in this PR: docs for GET /affiliate-partner/programs/:id/stats. That route has no trend (cms#510 changed GET /affiliate-partner/programs/:id); whether to document either is an open question.

Why

Approved follow-up by the repo manager; the docs should match the code.

How verified

  • 403 for every refusal: affiliate-cms v3.16.114:src/policies/verify-program-access.ts:24-37 ("Every refusal is HTTP 403 ... 'Not signed in' therefore reads 403, not 401"); route /tracking/performance/:programId uses trackingListPolicy (routes file :9, :30); no membership (including a nonexistent program) is refused at policy line ~128. Measured on prod: curl https://api.affitor.com/api/tracking/performance/1 with no session returns 403 ForbiddenError.
  • Period default: controller getPerformanceData has const { period = '7d', ... } = ctx.query, returned as meta.period (line ~860).
  • Dashboard: affiliate-dashboard origin/main src/components/ui/settings/ChartTrendBadge.tsx:20-21 renders nothing when the value is not finite (null), 0, or stable. Open dash#738 keeps that rule for null, so the sentence holds before and after it.
  • Build, check-agent-surface, check-docs-host and check-docs-host-http pass locally. No media.

🤖 Generated with Claude Code

…; dashboard trend from zero

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
affitor-docs Ready Ready Preview Oct 17, 2026 5:13am UTC

Request Review

… match the dashboard

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sonpiaz
sonpiaz merged commit 79ee050 into main Oct 17, 2026
3 checks passed
@sonpiaz
sonpiaz deleted the docs/performance-fixes branch October 17, 2026 05:14

This branch was successfully deployed

1 active deployment
Preview — ff0817eb Deployed Oct 17, 2026 by vercel[bot]
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.

1 participant