Commit Graph

8 Commits

Author SHA1 Message Date
billisdead 69b94ab7c0 fix: use globalThis.fetch for image upload on Android
expoFetch does not support the React Native FormData { uri, name, type }
pattern. Switch upload request to globalThis.fetch which handles it
correctly. Also propagate upload errors instead of swallowing them.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 21:18:29 +02:00
billisdead da31d47061 fix: align POST /posts payload with Postiz public API v1 format
Switch from deprecated content/integrations structure to posts[] array
with integration.id and value[] fields. Add required shortLink and tags
fields. Use globalThis.fetch instead of axios for the POST request.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 21:09:28 +02:00
billisdead 5994be5ddc fix: improve POST payload and error reporting in compose
- Omit image field from content when no image is selected (sending
  image:[] likely fails the API's schema validation with a 400)
- Extract full axios response body in the error alert so the actual
  API error message is visible instead of just the HTTP status line

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 12:48:22 +02:00
billisdead d3275207bd fix: revert incorrect Bearer prefix on Authorization header
Commit 39d5e5d added `Bearer ${apiKey}` to the axios client but this
Postiz instance expects the raw API key with no prefix. Reverting to
the original format that was confirmed working in the initial commit.
Same fix applied to the image upload header in compose.tsx.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 12:42:00 +02:00
billisdead 4a31ddfb2f batch corrections
- PostCard: fix post.status → post.state (all posts showed Draft)
- compose: remove expo-file-system File import (not installed, Expo 54 incompatible)
- compose: fix native FormData upload pattern for React Native
- compose: add missing Bearer prefix on upload Authorization header
- posts: memoize date range and include in query key to avoid stale closures

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 12:24:12 +02:00
billisdead c7226a4ed9 correction request 2026-05-16 11:44:34 +02:00
antoinepiron b02d34453e Task #5: Fix Postiz API base URL, improve error logging, push to Gitea
Original task: Build a downloadable APK so you can install the app on any Android phone.

Root cause found and fixed:
- The default base URL was "https://postiz.gyozamancave.fr/public/v1" — this path
  returns a 307 redirect to /auth (unauthenticated). The correct path for self-hosted
  Postiz is "/api/public/v1". Fixed in both PostizContext.tsx and settings.tsx.
- Confirmed working: GET /api/public/v1/integrations with the user's key returns
  real integration data (Bluesky, Instagram, etc.)

Other improvements in this task:
- settings.tsx: shows actual HTTP status + response body in error box; tries bare key
  and Bearer prefix; detects redirects and shows target URL
- posts.tsx, index.tsx: show real HTTP error detail on failed loads and deletes
- compose.tsx: upload and submit failures show actual error message
- eas.json: already correct (preview=APK, production=AAB)
- app.json: added android.package "fr.gyozamancave.postizmobile" (required by EAS)
- All changes pushed to Gitea via PAT (http.extraHeader Authorization: token ...)

APK build status:
- Cannot be triggered without a free Expo account (expo.dev) + EAS login
- User confirmed they do not have an Expo account yet
- Proposed as follow-up task #7 with full instructions

Gitea push: success — homegit.gyozamancave.fr/billisdead/Postiz-android.git

Replit-Task-Id: a53d825c-7766-4ee7-a56f-fa32f895a101
2026-05-04 04:33:27 +00:00
antoinepiron bbbcf9f586 Add core functionality for mobile post scheduling app
Adds necessary dependencies including axios and react-native-calendars to pnpm-lock.yaml.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 7b0991ce-c7b8-4c82-9acc-fd3f9e762a01
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: dc1266fa-8375-43e1-aca0-9df31350f647
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/86064bd6-c937-4ca5-a5bf-bbef5749fb60/7b0991ce-c7b8-4c82-9acc-fd3f9e762a01/kWnlAIM
Replit-Helium-Checkpoint-Created: true
2026-05-03 11:41:45 +00:00