I have a springboot application with a React/Typescript frontend. I current have the following two interfaces and an object created out of such.
export interface Order {
customer_id: number;
date: Date;
total: number;
spec: OrderSpec;
}
export interface OrderSpec {
order: Map<number, number>
}
I construct an object of type Order and try to create a post request using it as follows:
return fetch(url, {
method: method,
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(item),
});
My problem is that every time a request is sent the object looks like: the order map is always empty (see... spec:{order:{}})