Skip to content

Commit beae306

Browse files
committed
Merge branch 'listOfMed' of https://github.com/CodeForPhilly/balancer-main into listOfMed
2 parents 3b233e9 + 38c2e71 commit beae306

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

frontend/src/components/ChipsInput/ChipsInput.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ const ChipsInput: React.FC<ChipsInputProps> = ({
5959

6060
const handleSuggestionClick = (selected: string) => {
6161
onChange([...value, selected]);
62-
setInputFocused(false); // Close dropdown after selection
6362
setInputValue("");
6463
};
6564

@@ -131,7 +130,10 @@ const ChipsInput: React.FC<ChipsInputProps> = ({
131130
{filteredSuggestions.map((item, idx) => (
132131
<li
133132
key={idx}
134-
onClick={() => handleSuggestionClick(item)}
133+
onMouseDown={(e) => {
134+
e.preventDefault();
135+
handleSuggestionClick(item)
136+
}}
135137
className="px-3 py-2 cursor-pointer hover:bg-gray-100 text-sm"
136138
>
137139
{item}

server/api/views/listMeds/views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ def post(self, request):
4242
return Response({'error': 'Diagnosis not found'}, status=status.HTTP_404_NOT_FOUND)
4343
meds = {'first': [], 'second': [], 'third': []}
4444

45+
priorMeds = data.get('priorMedications', "").split(',')
46+
exclude_result.extend([med.strip() for med in priorMeds if med.strip()])
4547
included_set = set(include_result)
4648
excluded_set = set(exclude_result)
4749

0 commit comments

Comments
 (0)