refactor: format axios post request for better readability in createInventoryItem function

This commit is contained in:
THIS ONE IS A LITTLE BIT TRICKY KRUB 2025-03-31 22:16:14 +07:00
parent 486c16ab15
commit fd00ec02de

View File

@ -79,7 +79,10 @@ export async function createInventoryItem(
// Simulate network delay
await new Promise((resolve) => setTimeout(resolve, 500));
try {
const response = await axiosInstance.post<InventoryItem>("/api/inventory", item);
const response = await axiosInstance.post<InventoryItem>(
"/api/inventory",
item
);
return response.data;
} catch (error) {
// Simulate successful creation if API endpoint is not available