Skip to content

Commit

Permalink
Update site dropdown to map empty value to null for All Sites option
Browse files Browse the repository at this point in the history
  • Loading branch information
ay-bh committed Nov 2, 2024
1 parent 448b5ea commit 5fbc74f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions modules/issue_tracker/jsx/IssueCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const IssueCard = React.memo(function IssueCard({
const handleInputChange = (field, value) => {
setTempEditedIssue((prev) => ({
...prev,
[field]: value,
[field]: value === '' ? null : value,
}));
};

Expand Down Expand Up @@ -376,9 +376,8 @@ const IssueCard = React.memo(function IssueCard({
onChange={(e) =>
handleInputChange('centerID', e.target.value)
}
required
>
<option value="">No Site</option>
<option value="">All Sites</option>
{Object.entries(sites).map(([id, name]) => (
<option
key={id}
Expand Down Expand Up @@ -417,7 +416,7 @@ const IssueCard = React.memo(function IssueCard({
<label>Site:&nbsp;</label>
<span>
{sites[String(tempEditedIssue.centerID)] ||
'No Site'}
'All Sites'}
</span>
</div>
</>
Expand Down

0 comments on commit 5fbc74f

Please sign in to comment.