mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-13 19:57:12 +00:00
16 lines
588 B
TypeScript
16 lines
588 B
TypeScript
![]() |
import { makePath } from '@datahub/shared/mirage-addon/helpers/browse/dataset';
|
||
|
import { HandlerFunction, Request, Schema } from 'ember-cli-mirage';
|
||
|
import { MockEntity } from '@datahub/data-models/entity/mock/mock-entity';
|
||
|
|
||
|
export const browsePaths: HandlerFunction = (dbs: Schema, { queryParams: { type, urn } }: Request): Array<string> => {
|
||
|
if (type === 'dataset') {
|
||
|
const result = dbs.datasets.where({ uri: urn });
|
||
|
return result.models.map(model => makePath(model));
|
||
|
}
|
||
|
|
||
|
if (type === MockEntity.renderProps.apiEntityName) {
|
||
|
return ['/mockpath/'];
|
||
|
}
|
||
|
return [];
|
||
|
};
|