🚧 Søkefelt henter array med feilmeldinger fra backend
WIP: arrayet er tomt fordi søk ikke fungerer Co-authored-by: Sindre Kjelsrud <sindre.kjelsrud@nav.no>
This commit is contained in:
		
							parent
							
								
									76c34abd2b
								
							
						
					
					
						commit
						8134cfc239
					
				
					 4 changed files with 37 additions and 5 deletions
				
			
		|  | @ -2,5 +2,5 @@ | |||
|  * Konstanter vi bruker i diverse filer i applikasjonen | ||||
|  */ | ||||
| 
 | ||||
| //export const backendURL = "http://localhost:8080"
 | ||||
| export const backendURL = "https://helse-sprik.intern.dev.nav.no" | ||||
| export const backendURL = "http://localhost:8080" | ||||
| //export const backendURL = "https://helse-sprik.intern.dev.nav.no"
 | ||||
|  | @ -5,11 +5,26 @@ import Header from "./components/Header"; | |||
| import { PlusIcon } from "@navikt/aksel-icons"; | ||||
| import Filtermeny from "./components/Filtermeny"; | ||||
| import { useNavigate } from "react-router-dom"; | ||||
| import axios from "axios"; | ||||
| import { backendURL } from "./const"; | ||||
| 
 | ||||
| export default function Home() { | ||||
| 
 | ||||
|   const navigate = useNavigate() | ||||
| 
 | ||||
|   const handleChange = (soeketekst: string) => { | ||||
|     console.log("search changed")   | ||||
| 
 | ||||
|     axios.post(backendURL + "/api/hentsok", soeketekst, { | ||||
|       headers: { | ||||
|           'Content-Type': 'application/json' | ||||
|       } | ||||
|     }).then((response) => { | ||||
|       console.log(response.data); | ||||
|     }).catch((error) => { | ||||
|         console.log(error); | ||||
|     }) | ||||
|   } | ||||
| 
 | ||||
|   return ( | ||||
|     <main className="flex flex-col h-screen"> | ||||
|       <Header/> | ||||
|  | @ -17,7 +32,12 @@ export default function Home() { | |||
|         <Filtermeny/> | ||||
|         <div className="grow bg-bg-subtle px-32 py-8 flex flex-col gap-10"> | ||||
|           <div className="flex gap-12 items-end"> | ||||
|             <Search label="Søkefelt" description="Søk gjennom innmeldte feil (nøkkelord, tags, status)" hideLabel={false}/> | ||||
|             <Search  | ||||
|               label="Søkefelt" | ||||
|               description="Søk gjennom innmeldte feil (nøkkelord, tags, status)" | ||||
|               hideLabel={false} | ||||
|               onChange={(soeketekst) => handleChange(soeketekst)} | ||||
|             /> | ||||
|             <Button  | ||||
|               className="w-64 h-min"  | ||||
|               icon={<PlusIcon/>} | ||||
|  |  | |||
		Reference in a new issue
	
	 Markus Johansen
						Markus Johansen