diff options
author | 2022-01-07 00:03:59 +0100 | |
---|---|---|
committer | 2022-01-07 00:03:59 +0100 | |
commit | 71aeba7fda968f63c9469bce026267fa6b68ffd6 (patch) | |
tree | 41284779e0355b552519f8ce26ba509ffbf3a532 /src/api/server | |
parent | Review recipes routes (diff) | |
download | ferdium-app-71aeba7fda968f63c9469bce026267fa6b68ffd6.tar.gz ferdium-app-71aeba7fda968f63c9469bce026267fa6b68ffd6.tar.zst ferdium-app-71aeba7fda968f63c9469bce026267fa6b68ffd6.zip |
Use window.fetch in getRecipePackage, removes electron-fetch
Diffstat (limited to 'src/api/server')
-rw-r--r-- | src/api/server/ServerApi.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/api/server/ServerApi.ts b/src/api/server/ServerApi.ts index 0144a1069..c5c658df4 100644 --- a/src/api/server/ServerApi.ts +++ b/src/api/server/ServerApi.ts | |||
@@ -13,7 +13,6 @@ import { | |||
13 | removeSync, | 13 | removeSync, |
14 | PathOrFileDescriptor, | 14 | PathOrFileDescriptor, |
15 | } from 'fs-extra'; | 15 | } from 'fs-extra'; |
16 | import fetch from 'electron-fetch'; | ||
17 | 16 | ||
18 | import ServiceModel from '../../models/Service'; | 17 | import ServiceModel from '../../models/Service'; |
19 | import RecipePreviewModel from '../../models/RecipePreview'; | 18 | import RecipePreviewModel from '../../models/RecipePreview'; |
@@ -411,10 +410,11 @@ export default class ServerApi { | |||
411 | 410 | ||
412 | const packageUrl = `${apiBase()}/recipes/download/${recipeId}`; | 411 | const packageUrl = `${apiBase()}/recipes/download/${recipeId}`; |
413 | 412 | ||
414 | const res = await fetch(packageUrl); | 413 | const res = await window.fetch(packageUrl); |
415 | debug('Recipe downloaded', recipeId); | 414 | debug('Recipe downloaded', recipeId); |
416 | const buffer = await res.buffer(); | 415 | const blob = await res.blob(); |
417 | writeFileSync(archivePath, buffer); | 416 | const buffer = await blob.arrayBuffer(); |
417 | writeFileSync(tempArchivePath, Buffer.from(buffer)); | ||
418 | } | 418 | } |
419 | debug(archivePath); | 419 | debug(archivePath); |
420 | 420 | ||