Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashutosh137 committed Aug 30, 2024
1 parent 99d43c6 commit 19170a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/src/Layout/Components/BlogsGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function BlogsGroup({ BlogPost }: { BlogPost: Blog[] }) {
} else if (Sort === "oldest") {
sortedBlogs = sortedBlogs.sort((a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime());
} else if (Sort === "like") {
sortedBlogs = sortedBlogs.sort((a, b) => b.likes?.length - a.likes?.length);
sortedBlogs = sortedBlogs.sort((a, b) => b.likes!.length - a.likes!.length);
} else if (Sort === "default") {
sortedBlogs = [...BlogPost];
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/Redux/Blogslice/Blogslice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface Blog {
created_at: string;
tags: string[];
postedby: string;
likes:string[]
likes?:string[]
}

interface BlogState {
Expand Down

0 comments on commit 19170a0

Please sign in to comment.