This commit is contained in:
NotII
2025-04-07 19:25:24 +01:00
parent 7f7dd78818
commit 2f48ee38c2
102 changed files with 1825 additions and 761 deletions

View File

@@ -12,9 +12,9 @@ import {
addShippingMethod,
deleteShippingMethod,
updateShippingMethod,
} from "@/lib/shippingHelper";
import { ShippingMethod, ShippingData } from "@/lib/types";
ShippingMethod,
ShippingData
} from "@/lib/services/shipping-service";
import { ShippingTable } from "@/components/tables/shipping-table";
@@ -89,8 +89,8 @@ export default function ShippingPage() {
}
await addShippingMethod(
authToken,
newShipping
newShipping,
authToken
);
// Close modal and reset form before refreshing to avoid UI delays
@@ -125,9 +125,9 @@ export default function ShippingPage() {
}
await updateShippingMethod(
authToken,
newShipping._id,
newShipping
newShipping,
authToken
);
// Close modal and reset form before refreshing to avoid UI delays
@@ -150,7 +150,7 @@ export default function ShippingPage() {
const handleDeleteShipping = async (_id: string) => {
try {
const authToken = document.cookie.split("Authorization=")[1];
const response = await deleteShippingMethod(authToken, _id);
const response = await deleteShippingMethod(_id, authToken);
if (response.success) {
refreshShippingMethods(); // Refresh the list after deleting
} else {