Vote For Company
Method
GET
Auth
JWT (user)
Effect
Updates user + company votes
Response
{ updatedUser, updatedCompany }
| Component | v3 |
|---|---|
| Entry endpoint | n/a |
| Primary store | Directus (source data) |
| Auth | x-api-key for admin tools |
| Effect | n/a |
Sequence
Quickstart (v3)
- cURL
- JavaScript
curl -H "Authorization: Bearer <JWT>" \
https://api.example.com/v3/users/<device_id>/up/boycott/<company_id>
const res = await fetch(`https://api.example.com/v3/users/${deviceId}/up/boycott/${companyId}`, {
headers: { Authorization: `Bearer ${token}` },
});
const data = await res.json();
Differences (v2 vs v3)
- v2: no user-facing vote endpoint in this worker.
- v3: updates both user and company in Turso, returns updated records.
See also
- API reference: voteForCompanyV3
Code references
- Service:
src/services/user.service.ts(voteForCompany) - Route:
src/routes/users.ts(GET vote handler)