🚛 Massive refactor of dashboard

This commit is contained in:
2022-05-23 22:01:51 -07:00
parent f0505d7428
commit d80c672cd1
18 changed files with 127 additions and 77 deletions

View File

@@ -117,6 +117,7 @@ export const downloadAirDCPPItem =
instanceId: string,
resultId: string,
comicObjectId: string,
comicObject: any,
ADCPPSocket: any,
credentials: any,
): void =>
@@ -129,6 +130,7 @@ export const downloadAirDCPPItem =
true,
);
}
console.log(comicObject)
let bundleDBImportResult = {};
const downloadResult = await ADCPPSocket.post(
`search/${instanceId}/results/${resultId}/download`,
@@ -143,7 +145,7 @@ export const downloadAirDCPPItem =
dispatch({
type: LS_SINGLE_IMPORT,
meta: { remote: true },
data: { downloadStatus, comicObjectId },
data: { downloadStatus, comicObjectId, comicObject },
});
}
count += 1;
@@ -160,7 +162,7 @@ export const downloadAirDCPPItem =
(item) => item.id,
);
}
console.log(comicObjectId)
if (!isNil(downloadResult)) {
bundleDBImportResult = await axios({
method: "POST",

View File

@@ -132,9 +132,12 @@ export const getComicBooks = (options) => async (dispatch) => {
* @returns Nothing.
* @param payload
*/
export const importToDB = (payload?: any) => (dispatch) => {
export const importToDB = (sourceName: string, payload?: any) => (dispatch) => {
try {
const comicBookMetadata = {
rawFileDetails: {
name: "",
},
importStatus: {
isImported: true,
tagged: false,
@@ -143,7 +146,7 @@ export const importToDB = (payload?: any) => (dispatch) => {
},
},
sourcedMetadata: payload || null,
acquisition: { wanted: true },
acquisition: { source: { wanted: true, name: sourceName } },
};
dispatch({
type: IMS_CV_METADATA_IMPORT_CALL_IN_PROGRESS,
@@ -153,7 +156,7 @@ export const importToDB = (payload?: any) => (dispatch) => {
url: `${LIBRARY_SERVICE_BASE_URI}/rawImportToDb`,
method: "POST",
data: comicBookMetadata,
transformResponse: (r: string) => JSON.parse(r),
// transformResponse: (r: string) => JSON.parse(r),
})
.then((response) => {
const { data } = response;