13 lines
304 B
JavaScript
Raw Normal View History

2024-01-18 23:29:33 +04:00
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();
}