🚥 Socket.io integration WIP

This commit is contained in:
2021-05-27 10:12:20 -07:00
parent e8dc51755e
commit 1ca022fd99
6 changed files with 48 additions and 240 deletions

View File

@@ -1,9 +1,5 @@
import axios from "axios";
import fetch, { Response } from "node-fetch";
import {
IExtractionOptions,
IFolderData,
} from "../../server/interfaces/folder.interface";
import { IFolderData } from "../../server/interfaces/folder.interface";
import { API_BASE_URI } from "../constants/endpoints";
export async function walkFolder(path: string): Promise<Array<IFolderData>> {
@@ -21,20 +17,3 @@ export async function walkFolder(path: string): Promise<Array<IFolderData>> {
return data;
});
}
export async function extractCoverFromComicBookArchive(
extractionOptions: IExtractionOptions,
walkedFolders: Array<IFolderData>,
): Promise<Response> {
return await fetch(API_BASE_URI + "getComicCovers", {
method: "POST",
headers: {
Accept: "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({
extractionOptions,
walkedFolders,
}),
});
}