This commit is contained in:
zadit
2025-02-17 07:23:32 +07:00
parent df0dbafe18
commit 05c5545cbb
9 changed files with 169 additions and 52 deletions

View File

@@ -121,11 +121,11 @@ export async function updateItem(
selectedImage,
description);
const formData = new FormData();
formData.append("name", name);
formData.append("price", price);
formData.append("image", selectedImage);
formData.append("description", description);
formData.append("promoPrice", promoPrice);
if(name != null )formData.append("name", name);
if(price != null )formData.append("price", price);
if(selectedImage != null )formData.append("image", selectedImage);
if(description != null )formData.append("description", description);
if(promoPrice != null )formData.append("promoPrice", promoPrice);
const response = await fetch(`${API_BASE_URL}/item/set-item/${itemId}`, {
method: "PUT",