🐛 Fikser dato-serialiserings problem fra frontend
Co-authored-by: Markus A. R. Johansen <markus.aleksander.rakil.johansen@nav.no> Co-authored-by: Amalie Erdal Mansåker <amalie.erdal.mansaker@nav.no>
This commit is contained in:
parent
81b11d1c25
commit
2bdfe587a6
1 changed files with 5 additions and 6 deletions
|
@ -27,7 +27,6 @@ interface IFeilKort extends IFeilmelding {
|
||||||
const [arbeidsstatus, setArbeidsstatus] = useState(props.arbeidsstatus)
|
const [arbeidsstatus, setArbeidsstatus] = useState(props.arbeidsstatus)
|
||||||
const [haster, setHaster] = useState(props.haster)
|
const [haster, setHaster] = useState(props.haster)
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
Modal.setAppElement(document.getElementById('root'));
|
Modal.setAppElement(document.getElementById('root'));
|
||||||
}, []);
|
}, []);
|
||||||
|
@ -35,18 +34,16 @@ interface IFeilKort extends IFeilmelding {
|
||||||
const lagreEndringer = () => {
|
const lagreEndringer = () => {
|
||||||
setRedigeringsmodus(false)
|
setRedigeringsmodus(false)
|
||||||
|
|
||||||
const fields = {
|
const payload = {
|
||||||
id: props.id,
|
id: props.id,
|
||||||
tittel: tittel,
|
tittel: tittel,
|
||||||
beskrivelse: beskrivelse,
|
beskrivelse: beskrivelse,
|
||||||
dato: props.dato,
|
dato: props.dato.toISOString().replace('Z', ''),
|
||||||
arbeidsstatus: arbeidsstatus,
|
arbeidsstatus: arbeidsstatus,
|
||||||
haster: haster
|
haster: haster
|
||||||
}
|
}
|
||||||
|
|
||||||
const endretFeilmelding = new Feilmelding(fields)
|
axios.put(`/api/oppdaterfeil/${props.id}`, payload, {
|
||||||
|
|
||||||
axios.put(`/api/oppdaterfeil/${props.id}`, endretFeilmelding, {
|
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
}
|
}
|
||||||
|
@ -55,6 +52,8 @@ interface IFeilKort extends IFeilmelding {
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return(
|
return(
|
||||||
|
|
Reference in a new issue