feat: 🎸 update target route to support ssh type (#1038)

* feat: 🎸 update target route to support ssh type
This commit is contained in:
Dharini Jeeva authored and GitHub committed 2022-03-31 09:50:03 -07:00
1 parent 335df22a38
commit f877477cd7
2 files changed
+19 -2

No files matched your search

@@ -0,0 +1,7 @@
import Controller from '@ember/controller';
export default class ScopesScopeTargetsNewController extends Controller {
// =attributes
queryParams = ['type'];
}
@@ -3,14 +3,24 @@ import Route from '@ember/routing/route';
export default class ScopesScopeTargetsNewRoute extends Route {
// =methods
// =attributes
queryParams = {
type: {
refreshModel: true,
},
};
/**
* Creates a new unsaved target in current scope.
* @return {TargetModel}
*/
model() {
model(params) {
const scopeModel = this.modelFor('scopes.scope');
if (!params.type) {
params.type = 'tcp'; //tcp is the default type
}
return this.store.createRecord('target', {
type: 'tcp',
type: params.type,
scopeModel,
});
}