Skip to content

Commit

Permalink
Fix bug on add to group
Browse files Browse the repository at this point in the history
  • Loading branch information
jebessaD authored and Endalebob committed Jun 26, 2023
1 parent 8f36b7b commit 617364d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/admin/AddToGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ import { AiOutlineLoading3Quarters } from "react-icons/ai";
interface AddToGroupProps {
selectedApplicants: string[];
setShowModal: (show: boolean) => void;
setSelectedApplicants : (selectedApplicants:string[])=>void
}

const AddToGroup: React.FC<AddToGroupProps> = ({
selectedApplicants,
setShowModal,
setSelectedApplicants
}) => {
const [selectedGroup, setSelectedGroup] = useState("");
const { data, isLoading, error } = useGetGroupsQuery();
Expand All @@ -29,6 +31,8 @@ const AddToGroup: React.FC<AddToGroupProps> = ({
});

setShowModal(false);
setSelectedApplicants([]);

};

return (
Expand Down Expand Up @@ -64,6 +68,7 @@ const AddToGroup: React.FC<AddToGroupProps> = ({
</select>
<div className="text-end">
<button
disabled={selectedGroup.length != 1}
onClick={handleMoveToGroup}
className="bg-primary text-white p-2 rounded"
>
Expand Down
1 change: 1 addition & 0 deletions src/pages/admin/waitlist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ const WaitList: React.FC = () => {
<AddToGroup
setShowModal={setShowModal}
selectedApplicants={selectedApplicants}
setSelectedApplicants = {setSelectedApplicants}
/>
}
onClose={() => setShowModal(false)}
Expand Down

2 comments on commit 617364d

@vercel
Copy link

@vercel vercel bot commented on 617364d Jun 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 617364d Jun 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.