Skip to content
This repository has been archived by the owner on Oct 2, 2020. It is now read-only.

Commit

Permalink
Fix website sort
Browse files Browse the repository at this point in the history
  • Loading branch information
onbjerg committed Aug 12, 2019
1 parent 751d9c5 commit 4430441
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion api/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import cors from 'micro-cors'
import setupDb from './db'

const server = (db) => micro(cors()(async () => {
return db.collection('orgs').find({}).toArray()
return db.collection('orgs').find().sort({ _id: -1 }).toArray()
}))

setupDb()
Expand Down
8 changes: 1 addition & 7 deletions website/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,6 @@ class App extends React.Component {
)
}

const daos = this.state.daos.sort((a, b) => {
if (a.block > b.block) return -1
if (a.block < b.block) return 1
return 0
})

return (
<AppView title='Apiary Explorer'>
<Wrapper publicUrl="/">
Expand All @@ -139,7 +133,7 @@ class App extends React.Component {
</StatsCard>
</Stats>
<DaoGrid>
{daos.map(this.renderDao.bind(this))}
{this.state.daos.map(this.renderDao.bind(this))}
</DaoGrid>
</Wrapper>
</AppView>
Expand Down

0 comments on commit 4430441

Please sign in to comment.