feat: perf optim search

This commit is contained in:
Julien Froidefond
2025-02-20 22:33:39 +01:00
parent 7166a50cd7
commit b62b44eab9
12 changed files with 175 additions and 142 deletions

View File

@@ -16,12 +16,7 @@ export class ImageService extends BaseApiService {
return this.fetchWithCache<ImageResponse>(
`image-${path}`,
async () => {
const response = await fetch(url, { headers });
if (!response.ok) {
throw new Error(`Erreur HTTP: ${response.status} ${response.statusText}`);
}
const response = await this.fetchFromApi<Response>(url, headers, true);
const contentType = response.headers.get("content-type");
const arrayBuffer = await response.arrayBuffer();
const buffer = Buffer.from(arrayBuffer);