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')
repos = data.repositories.filter (item, index) ->
if item.default_branch.last_build
if item.active
console.log(item)
item
repos.sortBy('default_branch.last_build.finished_at').reverse()

View File

@ -11,7 +11,7 @@ Route = TravisRoute.extend
options = {}
if @get('auth.signedIn')
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: ->
@controllerFor('loading').set('layoutName', 'simple')

View File

@ -13,6 +13,7 @@ Route = TravisRoute.extend
options = {}
if @get('auth.signedIn')
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`

View File

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