Skip to content

Commit

Permalink
Sonar Commit 2
Browse files Browse the repository at this point in the history
Second commit for resolving Sonar Cloud issues
  • Loading branch information
TomDijkema committed Oct 23, 2024
1 parent 3de0688 commit 7c03bc0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/components/taxonomicService/TaxonomicService.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* Import Dependencies */
import classNames from 'classnames';
import moment from 'moment';
import { useState } from 'react';
import { Link, useNavigate, useParams } from 'react-router-dom';
import { Container, Row, Col } from 'react-bootstrap';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,16 @@ const FormBuilder = (props: Props) => {
}

formSection.fields.forEach(field => {
let jsonPath: string;
let jsonPath: string = '';

if (formSection.type === 'array') {
let pathSuffix: string = FlattenJSONPath(field.jsonPath).split('_').at(-1) as string;

jsonPath = `${formSection.jsonPath ?? ''}[0]['${pathSuffix}']`;
jsonPath = jsonPath.concat(`${formSection.jsonPath ?? ''}[0]['${pathSuffix}']`);

/* Add to initial form values array zero index */
jp.value(initialFormValues, jsonPath, DetermineInitialFormValue(field.type));
} else {
jsonPath = FlattenJSONPath(field.jsonPath);

/* Add to initial form values */
jp.value(initialFormValues, field.jsonPath, DetermineInitialFormValue(field.type));
}
Expand Down

0 comments on commit 7c03bc0

Please sign in to comment.