-
-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathnamespace.js
More file actions
29 lines (25 loc) · 825 Bytes
/
Copy pathnamespace.js
File metadata and controls
29 lines (25 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import ClassRoute from '../classes/class';
import getFullVersion from 'ember-api-docs/utils/get-full-version';
import { withScrollReset } from '../utils/with-scroll-reset';
@withScrollReset
export default class NamespaceRoute extends ClassRoute {
templateName = 'project-version/classes/class';
async model(params) {
const { project, project_version: compactVersion } =
this.paramsFor('project-version');
let projectRecord = await this.store.findRecord('project', project);
let projectVersion = getFullVersion(
compactVersion,
project,
projectRecord,
this.metaStore
);
const klass = params['namespace'];
return this.find('namespace', `${project}-${projectVersion}-${klass}`);
}
serialize(model) {
return {
namespace: model.get('name'),
};
}
}