fix owner page after api cleanup

This commit is contained in:
Lisa P 2015-10-13 17:27:12 +02:00
parent 7d6dd75bdf
commit 860e89dd86
4 changed files with 6 additions and 4 deletions

View File

@ -8,7 +8,8 @@ Controller = Ember.Controller.extend
data = @get('model') data = @get('model')
repos = data.repositories.filter (item, index) -> repos = data.repositories.filter (item, index) ->
if item.default_branch.last_build if item.active
console.log(item)
item item
repos.sortBy('default_branch.last_build.finished_at').reverse() repos.sortBy('default_branch.last_build.finished_at').reverse()

View File

@ -11,7 +11,7 @@ Route = TravisRoute.extend
options = {} options = {}
if @get('auth.signedIn') if @get('auth.signedIn')
options.headers = { Authorization: "token #{@auth.token()}" } options.headers = { Authorization: "token #{@auth.token()}" }
$.ajax(config.apiEndpoint + "/v3/owner/#{params.owner}", options) $.ajax(config.apiEndpoint + "/v3/owner/#{params.owner}?include=organization.repositories,repository.default_branch,build.commit", options)
beforeModel: -> beforeModel: ->
@controllerFor('loading').set('layoutName', 'simple') @controllerFor('loading').set('layoutName', 'simple')

View File

@ -13,6 +13,7 @@ Route = TravisRoute.extend
options = {} options = {}
if @get('auth.signedIn') if @get('auth.signedIn')
options.headers = { Authorization: "token #{@auth.token()}" } options.headers = { Authorization: "token #{@auth.token()}" }
$.ajax(config.apiEndpoint + "/v3/owner/#{transition.params.owner.owner}?include=user.repositories,organization.repositories,build.commit,repository.active", options) $.ajax(config.apiEndpoint + "/v3/owner/#{transition.params.owner.owner}?include=organization.repositories,repository.default_branch,build.commit", options).then (response) ->
response
`export default Route` `export default Route`

View File

@ -96,5 +96,5 @@
</div> </div>
</div> </div>
{{else}} {{else}}
<p>there is no build</p> <p class="row-item">There is no build on the default branch yet.</p>
{{/if}} {{/if}}