Skip to content

Commit fb1dfe2

Browse files
author
Nisarg Vadgama
committed
fix: reuse family lot function
1 parent c55a078 commit fb1dfe2

File tree

1 file changed

+4
-4
lines changed
  • frontend/src/views/CONSEP/TestingActivities/TestSearch

1 file changed

+4
-4
lines changed

frontend/src/views/CONSEP/TestingActivities/TestSearch/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ import {
4343
minStartDate,
4444
maxEndDate,
4545
formatExportData,
46-
columnVisibilityLocalStorageKey
46+
columnVisibilityLocalStorageKey,
47+
isFamilyLot
4748
} from './constants';
4849
import { THREE_HALF_HOURS, THREE_HOURS } from '../../../../config/TimeUnits';
4950
import {
@@ -322,7 +323,7 @@ const TestSearch = () => {
322323
};
323324
}
324325

325-
const isFamily = lot.toUpperCase().startsWith('F');
326+
const isFamily = isFamilyLot(lot);
326327
const limit = isFamily ? 13 : 5;
327328
return lot.length > limit
328329
? {
@@ -364,8 +365,7 @@ const TestSearch = () => {
364365
lotNumbers: validationResults
365366
}));
366367
// Auto-tab to next input if current input is valid and has reached max length
367-
const isFamily = sanitizedValue.toUpperCase().startsWith('F');
368-
const maxLength = isFamily ? 13 : 5;
368+
const maxLength = isFamilyLot(sanitizedValue) ? 13 : 5;
369369

370370
if (
371371
!validationResults[index].error

0 commit comments

Comments
 (0)