fix error bug

This commit is contained in:
hamid zarghami
2025-12-02 15:20:43 +03:30
parent a492251e96
commit a1443911fa
+10 -6
View File
@@ -87,10 +87,12 @@ export const ShipmentManagementModal = ({
placeholder="انتخاب روش ارسال"
value={selectedShipment}
onChange={(e: React.ChangeEvent<HTMLSelectElement>) => setSelectedShipment(e.target.value)}
items={availableShipments.map((shipment: Shipper) => ({
value: shipment._id.toString(),
label: shipment.name
}))}
items={availableShipments
.filter((shipment: Shipper) => shipment._id != null)
.map((shipment: Shipper) => ({
value: String(shipment._id),
label: shipment.name
}))}
/>
<Button
label="اضافه کردن"
@@ -109,7 +111,9 @@ export const ShipmentManagementModal = ({
<p className="text-gray-500 text-center py-8">هیچ روش ارسالی فعالی وجود ندارد</p>
) : (
<div className="space-y-3">
{adminShipments.map((shipment: ShipmentMethod) => (
{adminShipments
.filter((shipment: ShipmentMethod) => shipment._id != null)
.map((shipment: ShipmentMethod) => (
<div key={shipment._id} className="flex items-center justify-between p-4 bg-gray-50 rounded-xl">
<div>
<h4 className="font-medium">{shipment.name}</h4>
@@ -123,7 +127,7 @@ export const ShipmentManagementModal = ({
variant="danger"
size="sm"
label="حذف"
onClick={() => handleRemoveShipmentFromAdmin(shipment._id.toString())}
onClick={() => handleRemoveShipmentFromAdmin(String(shipment._id))}
isLoading={removeShipmentFromAdminMutation.isPending}
className="w-fit"
/>