Fixes broken flow

This commit is contained in:
Nithin David Thomas
2024-02-15 00:23:16 +05:30
parent 54bd3c38d5
commit f598b6886f
8 changed files with 174 additions and 50 deletions
@@ -0,0 +1,15 @@
export const findMatchingOption = (value, options, defaultValue) => {
const match = options.find(
option => option.value === value || option === value
);
return match ? match.value || match : defaultValue;
};
export const findCompanySizeMatch = (options, size) => {
return (
options.find(option => {
const upperLimit = option.value.split('-')[1]?.split('+')[0];
return size < (upperLimit ? Number(upperLimit) : Infinity);
})?.value || this.companySizeOptions[0].value
);
};