generated from Luis/nextjs-python-web-template
updating fetch request
This commit is contained in:
@@ -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) => {
|
||||
console.log(response);
|
||||
}).catch(error => {
|
||||
console.log("Fetch error: ", error)
|
||||
})
|
||||
fetch(endpoint)
|
||||
.then((response) => {
|
||||
console.log(response);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log("Fetch error: ", error);
|
||||
});
|
||||
};
|
||||
|
||||
if (!data) return <div>N/A</div>;
|
||||
|
||||
Reference in New Issue
Block a user