updating fetch request

This commit is contained in:
Arslan, Erdem
2024-01-21 21:24:17 +01:00
parent 522d7eb69a
commit ec67dd1bac

View File

@@ -14,11 +14,13 @@ export const ClientTableConfig = [
label: "End Point",
render: (value: any) => {
const onConsume = () => {
fetch(value).then((response) => {
console.log(response)
}).catch(error => {
console.log("Fetch error: ", error)
fetch(value)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.log("Fetch error: ", error);
});
};
return (
<Button onClick={onConsume} variant="outlined">
@@ -89,11 +91,13 @@ export const ServiceTableConfig = [
const onButtonClick = (endpoint: string) => {
console.log("which endpoint comes here?", endpoint);
fetch(endpoint).then((response) => {
fetch(endpoint)
.then((response) => {
console.log(response);
}).catch(error => {
console.log("Fetch error: ", error)
})
.catch((error) => {
console.log("Fetch error: ", error);
});
};
if (!data) return <div>N/A</div>;