Skip to content
Snippets Groups Projects
Commit e7048925 authored by VAUCHAIR MARLINE's avatar VAUCHAIR MARLINE
Browse files

:construction: setStock BACK

parent 942afb25
Branches
1 merge request!7🔀 V1
......@@ -30,4 +30,25 @@ export async function getItems(): Promise<Product[]> {
}));
return products;
}
export async function setStock(name: number, stock: number): Promise<void> {
const response = await axios.put(`${BASE_URL}/stock`, {
item_id: name,
quantity: stock
}, {
headers: {
'Content-Type': 'application/json',
'apikey': APIKEY,
}
})
.then(({ data }) => data)
.catch(error => {
console.error(error);
return "Error";
});
return response;
};
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment