bring back old things
This commit is contained in:
parent
275f8f14b2
commit
d687ebe01a
|
@ -8,23 +8,23 @@ Route = TravisRoute.extend
|
|||
model: ->
|
||||
apiEndpoint = config.apiEndpoint
|
||||
console.log(@auth)
|
||||
# $.ajax(apiEndpoint + '/v3/repos?repository.active=true', {
|
||||
$.ajax(apiEndpoint + '/v3/#{params.owner}?include=user.repositories,organization.repositories,build.commit', {
|
||||
$.ajax(apiEndpoint + '/v3/repos?repository.active=true', {
|
||||
# $.ajax(apiEndpoint + '/v3/#{params.owner}?include=user.repositories,organization.repositories,build.commit', {
|
||||
headers: {
|
||||
Authorization: 'token ' + @auth.token()
|
||||
}
|
||||
}).then (response) ->
|
||||
# response.repositories.sortBy('last_build.finished_at').filter( (repo) ->
|
||||
# repo.last_build
|
||||
# ).sort( (a, b) ->
|
||||
# if !a.last_build.finished_at || a.last_build.finished_at > b.last_build.finished_at
|
||||
# return -1
|
||||
# else if !b.last_build.finished_at || b.last_build.finished_at > a.last_build.finished_at
|
||||
# return 1
|
||||
# else
|
||||
# return 0
|
||||
# ).map( (repo) ->
|
||||
# Ember.Object.create(repo)
|
||||
# )
|
||||
response.repositories.sortBy('last_build.finished_at').filter( (repo) ->
|
||||
repo.last_build
|
||||
).sort( (a, b) ->
|
||||
if !a.last_build.finished_at || a.last_build.finished_at > b.last_build.finished_at
|
||||
return -1
|
||||
else if !b.last_build.finished_at || b.last_build.finished_at > a.last_build.finished_at
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
).map( (repo) ->
|
||||
Ember.Object.create(repo)
|
||||
)
|
||||
|
||||
`export default Route`
|
||||
|
|
Loading…
Reference in New Issue
Block a user