Skip to content

Commit

Permalink
LKE-4400 minor error changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesco Infante committed Oct 12, 2021
1 parent bb999a3 commit a2dd4c9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/backend/graphItemService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,7 @@ export class GraphItemService {
for (let i = 0; i < parsedCSV.records.length; i++) {
const properties = parsedCSV.records[i];
const UID = properties[0];
// The items to import are in rows 2, 3, etc (the header is row 1)
const rowNumber = i + 2;
const rowNumber = i + 1;

// Assign node to a batch
if (
Expand Down Expand Up @@ -266,8 +265,7 @@ export class GraphItemService {
// Parse row by row
for (let i = 0; i < parsedCSV.records.length; i++) {
let [from, to, ...propertyValues] = parsedCSV.records[i];
// The items to import are in rows 2, 3, etc (the header is row 1)
const rowNumber = i + 2;
const rowNumber = i + 1;

const sourceID = GraphItemService.nodeIDS.get(sourceType + from);
const targetID = GraphItemService.nodeIDS.get(destinationType + to);
Expand Down
2 changes: 1 addition & 1 deletion src/backend/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class CSVUtils {
error = `Missing values: Record/s ${missingValues.join(', ')}`;
}
if (tooManyValues.length > 0) {
if (error.length >= 0) {
if (error.length > 0) {
error += '<br>';
}
error += `Too many values: Record/s ${tooManyValues.join(', ')}`;
Expand Down
2 changes: 1 addition & 1 deletion src/public/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class CSVUtils {
error = `Missing values: Record/s ${missingValues.join(', ')}`;
}
if (tooManyValues.length > 0) {
if (error.length >= 0) {
if (error.length > 0) {
error += '<br>';
}
error += `Too many values: Record/s ${tooManyValues.join(', ')}`;
Expand Down

0 comments on commit a2dd4c9

Please sign in to comment.