Skip to content

Commit

Permalink
Maybe this is the right place to change the fields? (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
pipwilson authored Feb 11, 2025
1 parent 767287b commit 29aeddc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
13 changes: 13 additions & 0 deletions server/utils/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const expected = [
options: [
{ text: 'No', value: 'NO' },
{ text: 'Yes', value: 'YES' },
{ text: 'Null', value: 'NULL' },
],
value: 'NO',
},
Expand All @@ -80,6 +81,7 @@ const expected = [
options: [
{ text: 'No', value: 'NO' },
{ text: 'Yes', value: 'YES' },
{ text: 'Null', value: 'NULL' },
],
value: 'YES',
},
Expand All @@ -88,6 +90,7 @@ const expected = [
options: [
{ text: 'No', value: 'NO' },
{ text: 'Yes', value: 'YES' },
{ text: 'Null', value: 'NULL' },
],
value: 'NO',
},
Expand All @@ -101,6 +104,7 @@ const expected = [
{ text: '4', value: '4' },
{ text: '5', value: '5' },
{ text: '6', value: '6' },
{ text: 'Null', value: 'NULL' },
],
value: '6',
},
Expand All @@ -109,6 +113,7 @@ const expected = [
options: [
{ text: 'No', value: 'NO' },
{ text: 'Yes', value: 'YES' },
{ text: 'Null', value: 'NULL' },
],
value: 'YES',
},
Expand All @@ -122,6 +127,7 @@ const expected = [
options: [
{ text: 'No', value: 'NO' },
{ text: 'Yes', value: 'YES' },
{ text: 'Null', value: 'NULL' },
],
value: 'NO',
},
Expand All @@ -130,6 +136,7 @@ const expected = [
options: [
{ text: 'No', value: 'NO' },
{ text: 'Yes', value: 'YES' },
{ text: 'Null', value: 'NULL' },
],
value: 'YES',
},
Expand All @@ -138,6 +145,7 @@ const expected = [
options: [
{ text: 'No', value: 'NO' },
{ text: 'Yes', value: 'YES' },
{ text: 'Null', value: 'NULL' },
],
value: 'YES',
},
Expand All @@ -149,6 +157,7 @@ const expected = [
{ text: '2', value: '2' },
{ text: '3', value: '3' },
{ text: '4', value: '4' },
{ text: 'Null', value: 'NULL' },
],
value: '2',
},
Expand All @@ -157,6 +166,7 @@ const expected = [
options: [
{ text: 'No', value: 'NO' },
{ text: 'Yes', value: 'YES' },
{ text: 'Null', value: 'NULL' },
],
value: 'YES',
},
Expand All @@ -170,6 +180,7 @@ const expected = [
options: [
{ text: 'No', value: 'NO' },
{ text: 'Yes', value: 'YES' },
{ text: 'Null', value: 'NULL' },
],
value: 'NO',
},
Expand All @@ -178,6 +189,7 @@ const expected = [
options: [
{ text: 'No', value: 'NO' },
{ text: 'Yes', value: 'YES' },
{ text: 'Null', value: 'NULL' },
],
value: 'NO',
},
Expand All @@ -186,6 +198,7 @@ const expected = [
options: [
{ text: 'No', value: 'NO' },
{ text: 'Yes', value: 'YES' },
{ text: 'Null', value: 'NULL' },
],
value: 'NO',
},
Expand Down
5 changes: 4 additions & 1 deletion server/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,16 @@ const optionValues = (value: string, key: string, itemKey: string) => {
list.push({ text: i.toString(), value: i.toString() })
}

list.push({ text: 'Null', value: 'NULL' })

return list
}

if (['NO', 'YES'].includes(value)) {
if (['NO', 'YES', 'NULL'].includes(value)) {
return [
{ text: 'No', value: 'NO' },
{ text: 'Yes', value: 'YES' },
{ text: 'Null', value: 'NULL' },
]
}

Expand Down

0 comments on commit 29aeddc

Please sign in to comment.