🐛 Klarer å registrere og lagre ny feilmelding

Fikser deserialisering av dato og post-error

Co-authored-by: Sindre Kjelsrud <sindre.kjelsrud@nav.no>
This commit is contained in:
Amalie Mansåker 2023-07-21 10:07:51 +02:00
parent baf3e3a867
commit 3cd3a5e933
4 changed files with 11 additions and 8 deletions

View file

@ -12,14 +12,15 @@ export default function Feil() {
const [tittel, setTittel] = useState("");
const [beskrivelse, setBeskrivelse] = useState("");
const url = "https://helse-sprik.intern.dev.nav.no"
//const url = "http://localhost:5174"
const handleSubmit = () => {
axios.post("https://helse-sprik.intern.dev.nav.no/nyfeil",
axios.post(url + "/api/nyfeil",
{
"data": {
tittel: tittel,
beskrivelse: beskrivelse,
dato: new Date()
}
tittel: tittel,
beskrivelse: beskrivelse,
dato: new Date().toISOString().replace('Z', '')
}, {
headers: {
'Content-Type': 'application/json'