ok
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user