Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/danielsl4/TFG_DAM_2526/llms.txt

Use this file to discover all available pages before exploring further.

Following a team is the quickest way to keep up with a club you care about. Once you follow a team, its next five upcoming matches appear directly on your profile page so you always know when they play next. You can follow as many teams as you like, and unfollow them just as easily.

How following works

Any authenticated user can follow or unfollow any team. The action is a toggle — call the same endpoint once to follow, and again to unfollow. There is no separate follow and unfollow route. When you visit a team detail page, the response includes an isFollowing flag that tells the UI whether to display a “Follow” or “Unfollow” button. This flag is only populated when you are authenticated; unauthenticated visitors always see it as false.

Toggle follow on a team

Send a POST request to /teams/:id/toggle-follow, replacing :id with the team’s numeric ID. Include your JWT token in the Authorization header.
curl -X POST https://your-api/teams/5/toggle-follow \
  -H "Authorization: Bearer <your-token>"
{
  "message": "Ahora sigues al equipo",
  "isFollowing": true
}
This endpoint requires authentication. Requests without a valid Authorization: Bearer header will receive a 401 response.

Where followed teams appear

After following one or more teams, your profile page reflects the change in two places:
  • Followed teams list — a grid of team logos and names linking to each team’s detail page.
  • Upcoming matches — the next five scheduled matches (status pendiente) across all the teams you follow, drawn from the currently active season, ordered by date.
Each match card in the upcoming matches section shows the home and away teams, date, field, and your current porra vote if you have made one.
Head to the standings or team list pages to discover teams to follow. Each team detail page shows the follow button next to the team’s name.

Checking the follow state via the API

When you fetch a team’s detail, the isFollowing field in the response reflects your current status:
curl https://your-api/teams/5 \
  -H "Authorization: Bearer <your-token>"
{
  "id": 5,
  "name": "FC Rápidos",
  "logo_url": "https://...",
  "isFollowing": true,
  "players": [...],
  "stats": {...},
  "matches": [...]
}
Without a token the field is omitted (treated as false by the frontend).

Authentication

Log in to unlock team following and other personalised features.

User profile

See all your followed teams and their upcoming matches in one place.

Build docs developers (and LLMs) love