File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed
components/ReportingConfig Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import React from 'react';
22import PropTypes from 'prop-types' ;
33import { Collapsible , Icon } from '@edx/paragon' ;
44import { camelCaseObject } from '@edx/frontend-platform' ;
5+ import EnterpriseCatalogApiService from '../../data/services/EnterpriseCatalogApiService' ;
56import LMSApiService from '../../data/services/LmsApiService' ;
67import ReportingConfigForm from './ReportingConfigForm' ;
78import { snakeCaseFormData } from '../../utils' ;
@@ -26,7 +27,7 @@ class ReportingConfig extends React.Component {
2627 componentDidMount ( ) {
2728 Promise . allSettled ( [
2829 LMSApiService . fetchReportingConfigs ( this . props . enterpriseId ) ,
29- LMSApiService . fetchEnterpriseCustomerCatalogs ( this . props . enterpriseId ) ,
30+ EnterpriseCatalogApiService . fetchEnterpriseCustomerCatalogs ( this . props . enterpriseId ) ,
3031 LMSApiService . fetchReportingConfigTypes ( this . props . enterpriseId ) ,
3132 ] )
3233 . then ( ( responses ) => {
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ class EnterpriseCatalogApiService {
77
88 static apiClient = getAuthenticatedHttpClient ;
99
10+ static enterpriseCustomerCatalogsUrl = `${ EnterpriseCatalogApiService . baseUrl } /enterprise-catalogs/` ;
11+
1012 static fetchApplicableCatalogs ( { enterpriseId, courseRunIds } ) {
1113 // This API call will *only* obtain the enterprise's catalogs whose
1214 // catalog queries return/contain the specified courseRunIds.
@@ -23,6 +25,10 @@ class EnterpriseCatalogApiService {
2325 } ,
2426 ) . get ( url ) ;
2527 }
28+
29+ static fetchEnterpriseCustomerCatalogs ( enterpriseId ) {
30+ return EnterpriseCatalogApiService . apiClient ( ) . get ( `${ EnterpriseCatalogApiService . enterpriseCustomerCatalogsUrl } ?enterprise_customer=${ enterpriseId } ` ) ;
31+ }
2632}
2733
2834export default EnterpriseCatalogApiService ;
Original file line number Diff line number Diff line change @@ -24,8 +24,6 @@ class LmsApiService {
2424
2525 static createPendingUsersUrl = `${ LmsApiService . baseUrl } /enterprise/api/v1/link_pending_enterprise_users` ;
2626
27- static enterpriseCustomerCatalogsUrl = `${ LmsApiService . baseUrl } /enterprise/api/v1/enterprise_catalogs/` ;
28-
2927 static notificationReadUrl = `${ LmsApiService . baseUrl } /enterprise/api/v1/read_notification` ;
3028
3129 static enterpriseCustomerInviteKeyListUrl = `${ LmsApiService . baseUrl } /enterprise/api/v1/enterprise-customer-invite-key/basic-list/` ;
@@ -253,10 +251,6 @@ class LmsApiService {
253251 return LmsApiService . apiClient ( ) . post ( `${ LmsApiService . createPendingUsersUrl } /${ uuid } ` , formData ) ;
254252 }
255253
256- static fetchEnterpriseCustomerCatalogs ( enterpriseId ) {
257- return LmsApiService . apiClient ( ) . get ( `${ LmsApiService . enterpriseCustomerCatalogsUrl } ?enterprise_customer=${ enterpriseId } ` ) ;
258- }
259-
260254 static markBannerNotificationAsRead ( formData ) {
261255 return LmsApiService . apiClient ( ) . post ( LmsApiService . notificationReadUrl , formData ) ;
262256 }
You can’t perform that action at this time.
0 commit comments