🦸🏻 Integrating with Metron service
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
import axios from "axios";
|
||||
import { IFolderData, IExtractedComicBookCoverFile } from "threetwo-ui-typings";
|
||||
import { IFolderData } from "threetwo-ui-typings";
|
||||
import {
|
||||
API_BASE_URI,
|
||||
COMICBOOKINFO_SERVICE_URI,
|
||||
IMPORT_SERVICE_BASE_URI,
|
||||
} from "../constants/endpoints";
|
||||
import {
|
||||
IMS_COMICBOOK_METADATA_FETCHED,
|
||||
IMS_COMIC_BOOK_GROUPS_FETCHED,
|
||||
IMS_COMIC_BOOK_GROUPS_CALL_IN_PROGRESS,
|
||||
IMS_COMIC_BOOK_GROUPS_CALL_FAILED,
|
||||
@@ -19,8 +17,6 @@ import {
|
||||
IMS_CV_METADATA_IMPORT_FAILED,
|
||||
LS_IMPORT,
|
||||
} from "../constants/action-types";
|
||||
import { refineQuery } from "../shared/utils/filenameparser.utils";
|
||||
import sortBy from "array-sort-by";
|
||||
import { success } from "react-notification-system-redux";
|
||||
import { isNil } from "lodash";
|
||||
|
||||
@@ -208,8 +204,6 @@ export const fetchComicVineMatches =
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
/* return { issueSearchQuery, series: seriesSearchQuery.searchParams }; */
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
24
src/client/actions/metron.actions.tsx
Normal file
24
src/client/actions/metron.actions.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import axios from "axios";
|
||||
import { METRON_SERVICE_URI } from "../constants/endpoints";
|
||||
import {
|
||||
METRON_DATA_FETCH_SUCCESS,
|
||||
METRON_DATA_FETCH_IN_PROGRESS,
|
||||
} from "../constants/action-types";
|
||||
|
||||
export const fetchMetronResource = async (options) => {
|
||||
console.log(options);
|
||||
|
||||
const metronResourceResults = await axios.post(
|
||||
`${METRON_SERVICE_URI}/fetchResource`,
|
||||
options,
|
||||
);
|
||||
console.log(metronResourceResults);
|
||||
const foo = metronResourceResults.data.results.map((result) => {
|
||||
return {
|
||||
label: result.name,
|
||||
value: result.id,
|
||||
};
|
||||
});
|
||||
console.log({ options: foo, hasMore: false });
|
||||
return { options: foo, hasMore: false };
|
||||
};
|
||||
Reference in New Issue
Block a user