fix formatting
Some checks failed
checks-impure / test (pull_request) Successful in 31s
checks / test (pull_request) Failing after 2m16s

This commit is contained in:
erdemarslan
2023-12-09 18:36:24 +01:00
parent 647fc33acd
commit 01ce85bb15
4 changed files with 44 additions and 32 deletions

View File

@@ -22,7 +22,9 @@ export default function AccessPoint() {
.then((resp) => .then((resp) =>
resp.json().then((jsonData) => { resp.json().then((jsonData) => {
console.log(jsonData); console.log(jsonData);
jsonData.length > 0 ? setRepositoryData(jsonData) : setRepositoryData(APServiceRepositoryDummyData); jsonData.length > 0
? setRepositoryData(jsonData)
: setRepositoryData(APServiceRepositoryDummyData);
}), }),
) )
.then() .then()

View File

@@ -23,7 +23,9 @@ export default function Client1() {
.then((resp) => .then((resp) =>
resp.json().then((jsonData) => { resp.json().then((jsonData) => {
console.log(jsonData); console.log(jsonData);
jsonData.length > 0 ? setConsumerData(jsonData) : setConsumerData(Client1ConsumerData); jsonData.length > 0
? setConsumerData(jsonData)
: setConsumerData(Client1ConsumerData);
}), }),
) )
.then() .then()
@@ -33,11 +35,13 @@ export default function Client1() {
method: "GET", method: "GET",
// credentials: 'include', // credentials: 'include',
}) })
.then((resp) => .then((resp) =>
resp.json().then((jsonData) => { resp.json().then((jsonData) => {
console.log(jsonData); console.log(jsonData);
jsonData.length > 0 ? setProducerData(jsonData) : setProducerData(Client1ProducerData); jsonData.length > 0
}), ? setProducerData(jsonData)
: setProducerData(Client1ProducerData);
}),
) )
.then() .then()
.catch(); .catch();

View File

@@ -9,7 +9,7 @@ import {
Client2SummaryDetails, Client2SummaryDetails,
} from "@/mock/client_2"; } from "@/mock/client_2";
import CustomTable from "@/components/table"; import CustomTable from "@/components/table";
import {useEffect, useState} from "react"; import { useEffect, useState } from "react";
export default function Client1() { export default function Client1() {
const [consumerData, setConsumerData] = useState([]); const [consumerData, setConsumerData] = useState([]);
@@ -23,7 +23,9 @@ export default function Client1() {
.then((resp) => .then((resp) =>
resp.json().then((jsonData) => { resp.json().then((jsonData) => {
console.log(jsonData); console.log(jsonData);
jsonData.length > 0 ? setConsumerData(jsonData) : setConsumerData(Client2ConsumerData); jsonData.length > 0
? setConsumerData(jsonData)
: setConsumerData(Client2ConsumerData);
}), }),
) )
.then() .then()
@@ -33,11 +35,13 @@ export default function Client1() {
method: "GET", method: "GET",
// credentials: 'include', // credentials: 'include',
}) })
.then((resp) => .then((resp) =>
resp.json().then((jsonData) => { resp.json().then((jsonData) => {
console.log(jsonData); console.log(jsonData);
jsonData.length > 0 ? setProducerData(jsonData) : setProducerData(Client2ProducerData); jsonData.length > 0
}), ? setProducerData(jsonData)
: setProducerData(Client2ProducerData);
}),
) )
.then() .then()
.catch(); .catch();

View File

@@ -1,28 +1,30 @@
"use client"; "use client";
import {NoDataOverlay} from "@/components/noDataOverlay"; import { NoDataOverlay } from "@/components/noDataOverlay";
import SummaryDetails from "@/components/summary_card"; import SummaryDetails from "@/components/summary_card";
import CustomTable from "@/components/table"; import CustomTable from "@/components/table";
import {HomeDummyData, HomeTableConfig} from "@/mock/home"; import { HomeDummyData, HomeTableConfig } from "@/mock/home";
import {useEffect, useState} from "react"; import { useEffect, useState } from "react";
export default function Home() { export default function Home() {
const [homeData, setHomeData] = useState([]); const [homeData, setHomeData] = useState([]);
useEffect(() => { useEffect(() => {
fetch("http://localhost:2979/api/v1/get_entities", { fetch("http://localhost:2979/api/v1/get_entities", {
method: "GET", method: "GET",
// credentials: 'include', // credentials: 'include',
}) })
.then((resp) => .then((resp) =>
resp.json().then((jsonData) => { resp.json().then((jsonData) => {
console.log(jsonData); console.log(jsonData);
jsonData.length > 0 ? setHomeData(jsonData) : setHomeData(HomeDummyData); jsonData.length > 0
}), ? setHomeData(jsonData)
) : setHomeData(HomeDummyData);
.then() }),
.catch(); )
}, []); .then()
.catch();
}, []);
return ( return (
<div className="m-10"> <div className="m-10">