Skip to content

Commit

Permalink
Merge pull request #364 from tanyas-codes/refact/list-groups
Browse files Browse the repository at this point in the history
refactoring: lists the off-chain groups based on recent creation
  • Loading branch information
vplasencia authored Jan 30, 2024
2 parents f5a20e2 + e15da1a commit 5e4b68b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/dashboard/src/pages/groups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,10 @@ export default function GroupsPage(): JSX.Element {
>
{_groups
.filter(filterGroup)
.sort((a, b) =>
a.name < b.name ? -1 : a.name > b.name ? 1 : 0
.sort(
(a, b) =>
new Date(b.createdAt || "").getTime() - // Convert string to Date object
new Date(a.createdAt || "").getTime()
)
.map((group) => (
<Link
Expand Down
1 change: 1 addition & 0 deletions apps/dashboard/src/types/Group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export type Group = {
admin: string
apiEnabled?: boolean
apiKey?: string
createdAt?: string
}

export type GroupSize = {
Expand Down

0 comments on commit 5e4b68b

Please sign in to comment.