Skip to content

Avoid stale connected account fallback; post via mock social API and add JSON headers - #7

Open
Jakedoes1111 wants to merge 1 commit into
mainfrom
codex/decide-on-api-implementation-and-make-updates-5qea8e
Open

Avoid stale connected account fallback; post via mock social API and add JSON headers#7
Jakedoes1111 wants to merge 1 commit into
mainfrom
codex/decide-on-api-implementation-and-make-updates-5qea8e

Conversation

@Jakedoes1111

Copy link
Copy Markdown
Owner

Motivation

  • Prevent the scheduler from using potentially stale connectedAccounts state when the mock accounts endpoint cannot be reached.
  • Standardize scheduler publishing on the local mock social API instead of the partial OAuth client in UI code.
  • Ensure all JSON POSTs include the appropriate Content-Type: application/json header for API compatibility.
  • Fix an incorrect LinkedIn lifecycle state value returned by the OAuth posting helpers.

Description

  • Updated components/ContentScheduler.tsx to add a SocialAccount interface, socialApiBase, and fetchConnectedAccounts() which returns an empty list on failure instead of falling back to stale state.
  • Switched scheduler posting to the mock endpoint at /api/social/publish by mapping UI platform ids to apiName and sending JSON payloads with Content-Type: application/json.
  • Removed reliance on oauthService.isConnected in the scheduler and now check connectivity against the freshly fetched accounts before posting.
  • Modified services/oauthService.ts to add Content-Type: application/json headers to JSON POSTs and corrected LinkedIn lifecycleState from 'pUBLISHED' to 'PUBLISHED'.

Testing

  • No automated tests were run for these changes.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant