blob: f93d941697653da13f7fc28671fa2b10761006a0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
App.ServiceEnvironmentsNewController = Ember.Controller.extend
actions:
createEnvironment: ->
fields = @get('fields')
if App.Environment.valid(fields)
environment = @store.createRecord('environment', @get('fields'))
serviceId = @get('fields')['serviceId']
service = @store.find('service', serviceId).then (service) =>
environment.set('service', service)
environment.save().then =>
@transitionTo('environment', environment)
else
@set('showError', true)
|