🔩 Light refactoring

This commit is contained in:
2021-04-27 14:43:57 -07:00
parent a4715efe04
commit 2013d37b45
4 changed files with 12 additions and 17 deletions

View File

@@ -10,7 +10,11 @@ import { FS_API_BASE_URI } from "../constants/endpoints";
export async function walkFolder(path: string): Promise<Array<IFolderData>> {
return axios
.request<Array<IFolderData>>({
url: FS_API_BASE_URI + "/walkFolder",
url: FS_API_BASE_URI + "walkFolder",
method: "POST",
params: {
basePathToWalk: path,
},
transformResponse: (r: string) => JSON.parse(r),
})
.then((response) => {

View File

@@ -27,7 +27,7 @@ class Import extends React.Component<IProps, IState> {
}
public async startFolderWalk() {
console.log(await greet('dog'));
console.log(await greet("./comics"));
}
public render() {
return (

View File

@@ -2,19 +2,6 @@ declare module "*.png" {
const value: string;
export = value;
}
// declare module "*.worker.ts" {
// class ImportComicBooksWorker extends Worker {
// constructor();
// }
// export default ImportComicBooksWorker;
// }
// declare module "worker-loader!*" {
// class WebpackWorker extends Worker {
// constructor();
// }
// export default WebpackWorker;
// }
declare module "*.jpg";
declare module "*.gif";

View File

@@ -1,3 +1,7 @@
export async function greet(subject: string): string {
return `Hello, ${subject}!`;
import { walkFolder } from "../actions/fileops.actions";
import { IFolderData } from "../../server/interfaces/folder.interface";
export async function greet(path: string): Promise<IFolderData[]> {
console.log(path);
return await walkFolder("./comics");
}