I explain my problem of the day
in the following code, I post objects
my question, is it possible to post the time at which the post was made?
postbackend = () =>{
const config = {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({...this.state, items:this.props.items}),
};
const url = entrypoint + "/alluserpls";
fetch(url, config)
.then(res => res.json())
.then(res => {
if (res.error) {
alert(res.error);
} else {
alert(`ajouté avec l'ID ${res}!`);
}
}).catch(e => {
console.error(e);
}).finally(()=>this.setState({ redirect: true }));
}
I would simply like to recover the time at which the post was made Do you have an idea of how to fix this? Neff