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>
This commit is contained in:
@@ -4,7 +4,6 @@ import DateTimePicker from "@react-native-community/datetimepicker";
|
||||
import * as Haptics from "expo-haptics";
|
||||
import { Image } from "expo-image";
|
||||
import * as ImagePicker from "expo-image-picker";
|
||||
import { File } from "expo-file-system";
|
||||
import { fetch as expoFetch } from "expo/fetch";
|
||||
import React, { useState } from "react";
|
||||
import {
|
||||
@@ -88,12 +87,15 @@ export default function ComposeScreen() {
|
||||
const blob = await response.blob();
|
||||
formData.append("file", blob, "upload.jpg");
|
||||
} else {
|
||||
const file = new File(imageUri);
|
||||
formData.append("file", file as unknown as Blob);
|
||||
formData.append("file", {
|
||||
uri: imageUri,
|
||||
name: "upload.jpg",
|
||||
type: "image/jpeg",
|
||||
} as unknown as Blob);
|
||||
}
|
||||
const uploadRes = await expoFetch(`${baseUrl}/upload`, {
|
||||
method: "POST",
|
||||
headers: { Authorization: apiKey },
|
||||
headers: { Authorization: `Bearer ${apiKey}` },
|
||||
body: formData,
|
||||
});
|
||||
const data = await uploadRes.json() as PostizUploadResult;
|
||||
|
||||
Reference in New Issue
Block a user