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