Add Latest Posts support

This commit is contained in:
prototypa
2022-11-06 15:47:44 -05:00
parent 8c646d7f72
commit 2d0687d885
8 changed files with 102 additions and 52 deletions

View File

@ -64,3 +64,11 @@ export const findPostsByIds = async (ids) => {
return r;
}, []);
};
/** */
export const findLatestPosts = async ({ count }) => {
const _count = count || 4;
const posts = await fetchPosts();
return posts ? posts.slice(_count * -1) : [];
};