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