Skip to content

Return JSON sync summary in HTTP response#4

Merged
patrickeasters merged 1 commit into
mainfrom
json-response
May 31, 2026
Merged

Return JSON sync summary in HTTP response#4
patrickeasters merged 1 commit into
mainfrom
json-response

Conversation

@patrickeasters

Copy link
Copy Markdown
Member

Summary

  • run() in both functions now returns a dict instead of None
  • HTTP handlers return the dict directly; Flask auto-serialises it as JSON
  • Errors in individual sync steps appear as {"error": "..."} in the relevant key rather than only in logs
  • CLI mode pretty-prints the JSON via json.dumps(..., indent=2)

Example response from membership-sync:

{
  "salesforce": {"members": 142},
  "checkmein": {"uploaded": 142},
  "groups": {"added": 1, "removed": 0},
  "discord": {"tfi": {"added": 1, "removed": 0, "errors": 0}}
}

🤖 Generated with Claude Code

Both functions now return a structured dict from run() summarising what
changed (added/removed counts per service). Flask auto-serialises it as
JSON. Errors in individual sync steps surface as {"error": "..."} in the
relevant key rather than silently logging. CLI mode pretty-prints the JSON.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@patrickeasters
patrickeasters merged commit 8917333 into main May 31, 2026
1 check passed
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