Int_Prog/лаб3/lab3/public/scripts/api/updateObject.js
2024-01-19 01:24:45 +04:00

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();
}