Skip to content

Commit 70ff8d0

Browse files
committed
updated array destructured values with appropriate names
1 parent dae6b8b commit 70ff8d0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

app/modals/ServicesModal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const ServicesModal: React.FC<ServicesModalProps> = React.memo(({ i, app }) => {
2626
const { user, applications } = useContext(DashboardContext);
2727
const { servicesData, connectToDB } = useContext(ApplicationContext);
2828
const [services, setServices] = useState<Array<string>>([]);
29+
const [ cardName,dbType,dbURI,description,serviceType ] = applications[i]
2930

3031
const toggleService = service => {
3132
if (services.includes(service)) {
@@ -42,7 +43,7 @@ const ServicesModal: React.FC<ServicesModalProps> = React.memo(({ i, app }) => {
4243
// adding database type to make connection and fetchServiceNames more efficient
4344
useEffect(() => {
4445
console.log('Hi, inside useEffect in ServicesModal. Calling connectToDB function.');
45-
connectToDB(user, i, app, applications[i][2], applications[i][1]);
46+
connectToDB(user, i, app, dbURI, dbType);
4647
}, [i]);
4748

4849

0 commit comments

Comments
 (0)