fix: declare isUpdatingModalStatus and handleSaveModalStatus in Orders
All checks were successful
Deploy Canina / deploy (push) Successful in 30s
All checks were successful
Deploy Canina / deploy (push) Successful in 30s
This commit is contained in:
parent
26a992c030
commit
97cd1c72aa
@ -331,6 +331,27 @@ export default function Orders() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const [isUpdatingModalStatus, setIsUpdatingModalStatus] = useState(false);
|
||||||
|
|
||||||
|
const handleSaveModalStatus = async (newStatus: string) => {
|
||||||
|
if (!selectedOrder) return;
|
||||||
|
try {
|
||||||
|
setIsUpdatingModalStatus(true);
|
||||||
|
setModalStatus(newStatus);
|
||||||
|
await api.put(`/admin/orders/${selectedOrder.id}/status`, {
|
||||||
|
status: newStatus,
|
||||||
|
trackingNumber: modalTrackingCode || undefined,
|
||||||
|
});
|
||||||
|
await fetchOrders();
|
||||||
|
toast.success('وضعیت سفارش با موفقیت بروزرسانی شد');
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to update modal status', err);
|
||||||
|
toast.error('خطا در بروزرسانی وضعیت سفارش');
|
||||||
|
} finally {
|
||||||
|
setIsUpdatingModalStatus(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const handleSaveModalChanges = async () => {
|
const handleSaveModalChanges = async () => {
|
||||||
if (!selectedOrder) return;
|
if (!selectedOrder) return;
|
||||||
try {
|
try {
|
||||||
@ -351,6 +372,7 @@ export default function Orders() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const handleExecuteOrderRefund = async () => {
|
const handleExecuteOrderRefund = async () => {
|
||||||
if (!refundModalOrder) return;
|
if (!refundModalOrder) return;
|
||||||
try {
|
try {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user