mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-12 12:33:07 +00:00
added documentation for endpoint mock service
This commit is contained in:
@@ -128,8 +128,8 @@ import {
|
||||
MOCK_RESPONSE_MAP,
|
||||
MockResponseMap,
|
||||
mockResponseMap
|
||||
} from './dspace-rest-v2/mocks/mock-response-map';
|
||||
import { EndpointMockingRestService } from './dspace-rest-v2/endpoint-mocking-rest.service';
|
||||
} from '../shared/mocks/dspace-rest-v2/mocks/mock-response-map';
|
||||
import { EndpointMockingRestService } from '../shared/mocks/dspace-rest-v2/endpoint-mocking-rest.service';
|
||||
import { ENV_CONFIG, GLOBAL_CONFIG, GlobalConfig } from '../../config';
|
||||
import { SearchFilterService } from './shared/search/search-filter.service';
|
||||
import { SearchConfigurationService } from './shared/search/search-configuration.service';
|
||||
@@ -137,6 +137,10 @@ import { SelectableListService } from '../shared/object-list/selectable-list/sel
|
||||
import { RelationshipTypeService } from './data/relationship-type.service';
|
||||
import { SidebarService } from '../shared/sidebar/sidebar.service';
|
||||
|
||||
/**
|
||||
* When not in production, endpoint responses can be mocked for testing purposes
|
||||
* If there is no mock version available for the endpoint, the actual REST response will be used just like in production mode
|
||||
*/
|
||||
export const restServiceFactory = (cfg: GlobalConfig, mocks: MockResponseMap, http: HttpClient) => {
|
||||
if (ENV_CONFIG.production) {
|
||||
return new DSpaceRESTv2Service(http);
|
||||
|
Reference in New Issue
Block a user