Skip to content

Commit

Permalink
feat: sonarlint issues
Browse files Browse the repository at this point in the history
Signed-off-by: pranalidhanavade <[email protected]>
  • Loading branch information
pranalidhanavade committed Dec 5, 2024
1 parent 3ba32a5 commit 4b57ea8
Showing 1 changed file with 34 additions and 33 deletions.
67 changes: 34 additions & 33 deletions src/components/Verification/ConnectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,40 @@ const ConnectionList = (props: {
});
};


const selectOrganization = async (
item: IConnectionList,
checked: boolean,
) => {
try {
const index =
localOrgs?.length > 0
? localOrgs.findIndex((ele) => ele.connectionId === item.connectionId)
: -1;

const { connectionId, theirLabel, createDateTime } = item || {};
if (index === -1) {
setLocalOrgs((prev: LocalOrgs[]) => [
...prev,
{
connectionId,
theirLabel,
createDateTime,
},
]);
} else {
const updateLocalOrgs = [...localOrgs];
if (!checked) {
updateLocalOrgs.splice(index, 1);
}
setLocalOrgs(updateLocalOrgs);
}
} catch (error) {
console.error('SELECTED ORGANIZATION:::', error);
}
};


const generateTable = async (connections: IConnectionList[]) => {
try {
const connectionsData =
Expand Down Expand Up @@ -251,39 +285,6 @@ const ConnectionList = (props: {
}, [selectedConnectionList]);


const selectOrganization = async (
item: IConnectionList,
checked: boolean,
) => {
try {
const index =
localOrgs?.length > 0
? localOrgs.findIndex((ele) => ele.connectionId === item.connectionId)
: -1;

const { connectionId, theirLabel, createDateTime } = item || {};
if (index === -1) {
setLocalOrgs((prev: LocalOrgs[]) => [
...prev,
{
connectionId,
theirLabel,
createDateTime,
},
]);
} else {
const updateLocalOrgs = [...localOrgs];
if (!checked) {
updateLocalOrgs.splice(index, 1);
}
setLocalOrgs(updateLocalOrgs);
}
} catch (error) {
console.error('SELECTED ORGANIZATION:::', error);
}
};


return (
<div
id="verification_connection_list"
Expand Down

0 comments on commit 4b57ea8

Please sign in to comment.