commented out disable feature on toggle in agency master
This commit is contained in:
@@ -94,10 +94,10 @@ const AgencyMaster = () => {
|
||||
agency?.gst_number.toLowerCase().includes(searchTerm.toLowerCase())
|
||||
);
|
||||
|
||||
const activeCount = filteredData?.filter((a: any) => a.is_active === 1).length ?? 0;
|
||||
// const activeCount = filteredData?.filter((a: any) => a.is_active === 1).length ?? 0;
|
||||
|
||||
const managepost = filteredData?.map((agency: any, index: number) => {
|
||||
const isOnlyActive = activeCount === 1 && agency.is_active === 1;
|
||||
// const isOnlyActive = activeCount === 1 && agency.is_active === 1;
|
||||
|
||||
return {
|
||||
id: agency.id,
|
||||
@@ -120,7 +120,7 @@ const AgencyMaster = () => {
|
||||
size={"xs"}
|
||||
onChange={() => handleToggle(agency.id.toString(), Number(agency.is_active))}
|
||||
checked={Boolean(Number(agency.is_active))}
|
||||
disabled={isOnlyActive}
|
||||
// disabled={isOnlyActive}
|
||||
/>
|
||||
</Box>
|
||||
</HStack>
|
||||
|
||||
Reference in New Issue
Block a user