Skip to content

Commit

Permalink
feat: update the groups dropdown filters data source to enterprise gr…
Browse files Browse the repository at this point in the history
…oups
  • Loading branch information
jajjibhai008 committed Feb 18, 2025
1 parent 32858b5 commit 867f608
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/components/Admin/AdminSearchForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ class AdminSearchForm extends React.Component {
</option>
{groups.map(group => (
<option
value={group.enterprise_group_uuid}
key={group.enterprise_group_uuid}
value={group.uuid}
key={group.uuid}
>
{group.enterprise_group_name}
{group.name}
</option>
))}
</Form.Control>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { fetchPaginatedData } from '../../../../data/services/apiServiceUtils';
* @param {*} queryKey The queryKey from the associated `useQuery` call.
* @returns The enterprise group object
*/
const getAllFlexEnterpriseGroups = async ({ enterpriseId }) => {
export const getAllFlexEnterpriseGroups = async ({ enterpriseId }) => {
const { results } = await fetchPaginatedData(`${LmsApiService.enterpriseGroupListUrl}?enterprise_uuids=${enterpriseId}`);
const flexGroups = results.filter(result => result.groupType === 'flex');
return flexGroups;
Expand Down
6 changes: 3 additions & 3 deletions src/data/actions/enterpriseGroups.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
FETCH_ENTERPRISE_GROUPS_FAILURE,
CLEAR_ENTERPRISE_GROUPS,
} from '../constants/enterpriseGroups';
import EnterpriseDataApiService from '../services/EnterpriseDataApiService';
import { getAllFlexEnterpriseGroups } from '../../components/learner-credit-management/data/hooks/useAllFlexEnterpriseGroups';

const fetchEnterpriseGroupsRequest = () => ({ type: FETCH_ENTERPRISE_GROUPS_REQUEST });
const fetchEnterpriseGroupsSuccess = data => ({
Expand All @@ -20,9 +20,9 @@ const fetchEnterpriseGroupsFailure = error => ({
const fetchEnterpriseGroups = enterpriseId => (
(dispatch) => {
dispatch(fetchEnterpriseGroupsRequest());
return EnterpriseDataApiService.fetchEnterpriseGroups(enterpriseId)
return getAllFlexEnterpriseGroups({ enterpriseId })
.then((response) => {
dispatch(fetchEnterpriseGroupsSuccess(response.data));
dispatch(fetchEnterpriseGroupsSuccess(response));
})
.catch((error) => {
logError(error);
Expand Down

0 comments on commit 867f608

Please sign in to comment.