add missing headers

This commit is contained in:
m
2026-07-14 09:59:41 +02:00
parent 76ceafa56c
commit 333387ad98
5 changed files with 18 additions and 2 deletions
+6
View File
@@ -15,11 +15,17 @@ export function useUpload() {
const results = await Promise.allSettled(
files.map(async (file) => {
const fsFile = new File(file.uri);
const headers: Record<string, string> = {};
const token = apiClient.getAccessToken();
if (token) {
headers['Authorization'] = `Bearer ${token}`;
}
const result = await fsFile.upload(`${API_BASE_URL}${ENDPOINTS.UPLOAD}`, {
httpMethod: 'POST',
uploadType: UploadType.MULTIPART,
fieldName: 'file',
mimeType: file.type,
headers,
});
if (result.status >= 400) {