Change sort to base on created_at

This commit is contained in:
Justin Edmund 2022-02-27 00:37:16 -08:00
parent 3ded388ffa
commit 0139b66e2e

View file

@ -35,7 +35,7 @@ const ProfileRoute: React.FC = () => {
})
const parties: Party[] = response.data.user.parties
setParties(parties.sort((a, b) => (a.updated_at > b.updated_at) ? -1 : 1))
setParties(parties.sort((a, b) => (a.created_at > b.created_at) ? -1 : 1))
})
.then(() => {
setFound(true)
@ -74,7 +74,7 @@ const ProfileRoute: React.FC = () => {
return <GridRep
shortcode={party.shortcode}
name={party.name}
updatedAt={new Date(party.updated_at)}
createdAt={new Date(party.created_at)}
raid={party.raid}
grid={party.weapons}
key={`party-${i}`}