🦸🏻 Integrating with Metron service

This commit is contained in:
2022-01-04 07:54:18 -08:00
parent ac563b9ce9
commit 2c0664506e
7 changed files with 113 additions and 8 deletions

View 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 };
};