fix and update

This commit is contained in:
lendry
2026-07-01 23:27:48 +03:00
parent 2b88e028c6
commit bcdfbc3861
36 changed files with 1504 additions and 320 deletions

View File

@@ -1007,6 +1007,7 @@ export async function apiFetch<T>(
? { 'Content-Type': 'application/json' }
: {}),
...(resolvedToken ? { Authorization: `Bearer ${resolvedToken}` } : {}),
...(behavior.silent ? { 'X-Id-Passive-Activity': '1' } : {}),
...(options.headers as Record<string, string> | undefined)
};
@@ -1075,8 +1076,14 @@ export interface MediaAccessResponse {
expiresAt: string;
}
export async function fetchDocumentPhotoUrl(userId: string, storageKey: string, token?: string | null) {
export async function fetchDocumentPhotoUrl(
userId: string,
storageKey: string,
token?: string | null,
fileName?: string
) {
const query = new URLSearchParams({ storageKey });
if (fileName) query.set('fileName', fileName);
return apiFetch<MediaAccessResponse>(`/media/users/${userId}/documents/photo-url?${query.toString()}`, {}, token);
}