Charlie Tran c2c6f66ca8
feat(frontend): Module consolidation for some test modules and reduces errors from unsupported API calls (#1844)
* frontend - Module consolidation for some test modules and reduces errors from unsupported API calls

* Fix broken test
2020-09-03 10:37:02 -07:00

23 lines
1.0 KiB
TypeScript

import { getDatasetSchema } from '@datahub/datasets-core/mirage-addon/helpers/schema';
import { getDataPlatforms } from '@datahub/datasets-core/mirage-addon/helpers/platforms';
import { getDatasetOwnership } from '@datahub/datasets-core/mirage-addon/helpers/ownership';
import { Server } from 'ember-cli-mirage';
import { IMirageServer } from '@datahub/utils/types/vendor/ember-cli-mirage-deprecated';
// TODO: [META-11940] Looks like mirage server types are incompatible but is outside the scope of this
// migration. Should return to clean up
export function datasetsMirageConfig(server: Server | IMirageServer): void {
server = server as IMirageServer;
server.namespace = '/api/v2';
server.get('/datasets/:urn/schema', getDatasetSchema);
// Temporary solution as we don't need real upstreams at the moment, we just don't wnat mirage to throw
// any errors
server.get('/datasets/:urn/upstreams', () => []);
server.get('/list/platforms', getDataPlatforms);
server.get(`datasets/:urn/owners`, getDatasetOwnership);
}