💽 Debugging comic import
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
|||||||
IMS_SOCKET_DATA_FETCHED,
|
IMS_SOCKET_DATA_FETCHED,
|
||||||
IMS_SOCKET_CONNECTION_CONNECTED,
|
IMS_SOCKET_CONNECTION_CONNECTED,
|
||||||
IMS_RAW_IMPORT_SUCCESSFUL,
|
IMS_RAW_IMPORT_SUCCESSFUL,
|
||||||
|
IMS_RAW_IMPORT_FAILED,
|
||||||
} from "../constants/action-types";
|
} from "../constants/action-types";
|
||||||
|
|
||||||
export async function walkFolder(path: string): Promise<Array<IFolderData>> {
|
export async function walkFolder(path: string): Promise<Array<IFolderData>> {
|
||||||
@@ -34,13 +35,20 @@ export const rawImportToDB = (payload: any) => async (dispatch) => {
|
|||||||
data: {
|
data: {
|
||||||
payload,
|
payload,
|
||||||
},
|
},
|
||||||
}).then((result) => {
|
})
|
||||||
dispatch({
|
.then((result) => {
|
||||||
type: IMS_RAW_IMPORT_SUCCESSFUL,
|
dispatch({
|
||||||
rawImportCompleted: result,
|
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) => {
|
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
@@ -12,3 +12,4 @@ export const IMS_SOCKET_CONNECTION_DISCONNECTED =
|
|||||||
export const IMS_SOCKET_ERROR = "IMS_SOCKET_ERROR";
|
export const IMS_SOCKET_ERROR = "IMS_SOCKET_ERROR";
|
||||||
|
|
||||||
export const IMS_RAW_IMPORT_SUCCESSFUL = "IMS_RAW_IMPORT_SUCCESSFUL";
|
export const IMS_RAW_IMPORT_SUCCESSFUL = "IMS_RAW_IMPORT_SUCCESSFUL";
|
||||||
|
export const IMS_RAW_IMPORT_FAILED = "IMS_RAW_IMPORT_FAILED";
|
||||||
|
|||||||
@@ -4,12 +4,14 @@ import {
|
|||||||
IMS_SOCKET_DATA_FETCHED,
|
IMS_SOCKET_DATA_FETCHED,
|
||||||
IMS_SOCKET_ERROR,
|
IMS_SOCKET_ERROR,
|
||||||
IMS_RAW_IMPORT_SUCCESSFUL,
|
IMS_RAW_IMPORT_SUCCESSFUL,
|
||||||
|
IMS_RAW_IMPORT_FAILED,
|
||||||
} from "../constants/action-types";
|
} from "../constants/action-types";
|
||||||
const initialState = {
|
const initialState = {
|
||||||
dataTransferred: false,
|
dataTransferred: false,
|
||||||
comicBookMetadata: [],
|
comicBookMetadata: [],
|
||||||
socketConnected: false,
|
socketConnected: false,
|
||||||
rawImportCompleted: {},
|
rawImportDetails: {},
|
||||||
|
rawImportError: {},
|
||||||
};
|
};
|
||||||
|
|
||||||
function fileOpsReducer(state = initialState, action) {
|
function fileOpsReducer(state = initialState, action) {
|
||||||
@@ -29,7 +31,12 @@ function fileOpsReducer(state = initialState, action) {
|
|||||||
case IMS_RAW_IMPORT_SUCCESSFUL:
|
case IMS_RAW_IMPORT_SUCCESSFUL:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
rawImportCompleted: action.rawImportCompleted,
|
rawImportDetails: action.rawImportDetails,
|
||||||
|
};
|
||||||
|
case IMS_RAW_IMPORT_FAILED:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
rawImportErorr: action.rawImportError,
|
||||||
};
|
};
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
|
|||||||
Reference in New Issue
Block a user