23 lines
459 B
JavaScript
23 lines
459 B
JavaScript
const items = [
|
|
{
|
|
"productId": 1,
|
|
"quantity": 2,
|
|
"unitPrice": 100,
|
|
"total": 200
|
|
}
|
|
];
|
|
const po = {
|
|
"poNumber": "TEST-001",
|
|
"issueDate": "2026-08-27T00:00:00Z",
|
|
"items": items
|
|
};
|
|
|
|
fetch('http://localhost:8080/api/purchase-orders', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
'Authorization': 'Bearer test'
|
|
},
|
|
body: JSON.stringify(po)
|
|
}).then(r => r.text()).then(console.log).catch(console.error);
|