trying some thing in the settings route. No idea what I'm doing

This commit is contained in:
Lisa Passing 2015-07-07 18:47:57 +02:00
parent b575d78250
commit 572804653c

View File

@ -1,4 +1,5 @@
`import TravisRoute from 'travis/routes/basic'`
`import config from 'travis/config/environment'`
Route = TravisRoute.extend
titleToken: 'Settings'
@ -6,15 +7,32 @@ Route = TravisRoute.extend
model: ->
repo = @modelFor('repo')
console.log('######### YEHA ###############')
repo.fetchSettings().then (settings) ->
console.log(settings)
repo.set('settings', settings)
# return Ember.RSVP.hash({
# settings: repo.fetchSettings(),
# envVars: repo.envVars(),
# sshKey: repo.sshKey()
# })
# return {
# settings: (->
# $.ajax('https://api.travis-ci.org/v3/repos/#{repo.id}/settings', {
# headers: {
# Authorization: 'token ' + @auth.token()
# }
# }).then (response) ->
# console.log(response);
# return response
# )
# env_vars: (->
# $.ajax('/settings/env_vars?repository_id={repo.id}', {
# headers: {
# Authorization: 'token ' + @auth.token()
# }
# }).then (response) ->
# console.log(response);
# return response
# )
# }
`export default Route`