💽 Debugging comic import

This commit is contained in:
2021-06-02 15:52:58 -07:00
parent 7e03a7bbe6
commit 20808b585c
5 changed files with 24 additions and 16353 deletions

View File

@@ -9,6 +9,7 @@ import {
IMS_SOCKET_DATA_FETCHED,
IMS_SOCKET_CONNECTION_CONNECTED,
IMS_RAW_IMPORT_SUCCESSFUL,
IMS_RAW_IMPORT_FAILED,
} from "../constants/action-types";
export async function walkFolder(path: string): Promise<Array<IFolderData>> {
@@ -34,13 +35,20 @@ export const rawImportToDB = (payload: any) => async (dispatch) => {
data: {
payload,
},
}).then((result) => {
dispatch({
type: IMS_RAW_IMPORT_SUCCESSFUL,
rawImportCompleted: result,
})
.then((result) => {
dispatch({
type: IMS_RAW_IMPORT_SUCCESSFUL,
rawImportDetails: result,
});
return result;
})
.catch((error) => {
dispatch({
type: IMS_RAW_IMPORT_FAILED,
rawImportDetails: error,
});
});
return result;
});
};
export const fetchComicBookMetadata = (options) => async (dispatch) => {

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -12,3 +12,4 @@ export const IMS_SOCKET_CONNECTION_DISCONNECTED =
export const IMS_SOCKET_ERROR = "IMS_SOCKET_ERROR";
export const IMS_RAW_IMPORT_SUCCESSFUL = "IMS_RAW_IMPORT_SUCCESSFUL";
export const IMS_RAW_IMPORT_FAILED = "IMS_RAW_IMPORT_FAILED";

View File

@@ -4,12 +4,14 @@ import {
IMS_SOCKET_DATA_FETCHED,
IMS_SOCKET_ERROR,
IMS_RAW_IMPORT_SUCCESSFUL,
IMS_RAW_IMPORT_FAILED,
} from "../constants/action-types";
const initialState = {
dataTransferred: false,
comicBookMetadata: [],
socketConnected: false,
rawImportCompleted: {},
rawImportDetails: {},
rawImportError: {},
};
function fileOpsReducer(state = initialState, action) {
@@ -29,7 +31,12 @@ function fileOpsReducer(state = initialState, action) {
case IMS_RAW_IMPORT_SUCCESSFUL:
return {
...state,
rawImportCompleted: action.rawImportCompleted,
rawImportDetails: action.rawImportDetails,
};
case IMS_RAW_IMPORT_FAILED:
return {
...state,
rawImportErorr: action.rawImportError,
};
default:
return state;