🔩 Light refactoring
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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 (
|
||||
|
||||
13
src/client/types/index.d.ts
vendored
13
src/client/types/index.d.ts
vendored
@@ -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";
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user