⚰️ Purger litt unødvendig kode / kommentarer
Co-authored-by: Markus A. R. Johansen <markus.aleksander.rakil.johansen@nav.no>
This commit is contained in:
parent
f1efaa8bce
commit
4da4b95fae
4 changed files with 16 additions and 44 deletions
|
@ -1,30 +1,13 @@
|
|||
import FeilCard from "./FeilCard";
|
||||
import { backendURL } from "../const.ts";
|
||||
import { Feilmelding } from "../interface.ts";
|
||||
import { useState } from "react";
|
||||
/**
|
||||
*
|
||||
* @returns Komponent for returnering av konteiner med alle feilinnmeldingene.
|
||||
*/
|
||||
// const fetcher = (url: RequestInfo | URL) => fetch(url).then(r => r.json())
|
||||
|
||||
// const test = async () => {
|
||||
// const response = await fetch(backendURL + "/api/hentallefeil")
|
||||
// const data = await response.json() // data er Promise
|
||||
// return data.then({
|
||||
|
||||
// })
|
||||
// }
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
const CardsContainer = () => {
|
||||
const [test, setTest] = useState([]);
|
||||
const feilMeldinger: Feilmelding[] = test;
|
||||
|
||||
async function fetchAlleFeil() {
|
||||
// const {data, error, isLoading } = useSWR("/api/hentallefeil", fetcher)
|
||||
// if (error) return <div>fail</div>
|
||||
// if (isLoading) return <div>loader</div>
|
||||
// return <div>hello {data.data}!</div>
|
||||
|
||||
const response = await fetch(backendURL + "/api/hentallefeil", {
|
||||
method: "GET",
|
||||
headers: {
|
||||
|
@ -43,11 +26,7 @@ const CardsContainer = () => {
|
|||
return response;
|
||||
}
|
||||
|
||||
// fetchAlleFeil();
|
||||
|
||||
const feilMeldinger: Feilmelding[] = test;
|
||||
|
||||
// console.log(test())
|
||||
useEffect(() => {fetchAlleFeil()})
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
@ -62,11 +41,9 @@ const CardsContainer = () => {
|
|||
/>
|
||||
))}
|
||||
</div>
|
||||
<div>
|
||||
<br />
|
||||
<p>Forsøker å loade feil objekter her:</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
export default CardsContainer;
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
/*
|
||||
* Konstanter vi bruker i diverse filer i applikasjonen
|
||||
*/
|
||||
|
||||
// export const backendURL = "http://localhost:8080"
|
||||
export const backend = "https://helse-sprik.intern.dev.nav.no"
|
||||
export const backendURL = "http://localhost:8080"
|
||||
// export const backend = "https://helse-sprik.intern.dev.nav.no"
|
Reference in a new issue