Update guides sort order

This commit is contained in:
Kamran Ahmed
2019-11-13 21:54:31 +04:00
parent 8fe4bc5472
commit 32c2bef9d8
3 changed files with 16 additions and 11 deletions

View File

@@ -3,7 +3,12 @@ import authors from "data/authors";
import siteConfig from "data/site";
export const getAllGuides = () => {
return guides;
return guides.filter(guide => !guide.draft)
.sort((a, b) => new Date(b.updatedAt) - new Date(a.updatedAt));
};
export const getFeaturedGuides = () => {
return getAllGuides().filter(guide => guide.featured);
};
export const getRequestedGuide = req => {