13 lines
295 B
JavaScript
13 lines
295 B
JavaScript
import { serverPath } from "../variables.js";
|
|
|
|
export async function createObject(objectJSON) {
|
|
const response = await fetch(`${serverPath}/products`, {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
},
|
|
body: objectJSON,
|
|
});
|
|
|
|
return response.json();
|
|
} |