This commit is contained in:
zadit
2024-11-01 11:33:26 +07:00
parent 5a2b9b2f86
commit 32e8ebd69b
20 changed files with 812 additions and 509 deletions

View File

@@ -245,6 +245,24 @@ export async function updateItemType(
}
}
export const moveItemType = async (itemTypeId, targetItemTypeId, fromOrder, toOrder) => {
try {
const response = await fetch(`${API_BASE_URL}/item/moveType/${itemTypeId}/${targetItemTypeId}/${fromOrder}/${toOrder}`, {
method: 'PUT',
headers: {
Authorization: `Bearer ${getAuthToken()}`,
},
});
if (!response.ok) {
throw new Error('Failed to move item type');
}
return await response.json();
} catch (error) {
console.error(error);
throw error;
}
};
export async function deleteItemType(shopId, itemTypeId) {
try {
const response = await fetch(