mirror of
https://github.com/ivabus/gui
synced 2025-06-07 15:50:27 +03:00
#67 use GET /posts?tag=featured_courses to render featured courses
This commit is contained in:
parent
199397548d
commit
5769c36485
1 changed files with 9 additions and 2 deletions
|
@ -135,8 +135,15 @@ async function getInstalledPackages() {
|
|||
}
|
||||
|
||||
export async function getFeaturedCourses(): Promise<Course[]> {
|
||||
const courses = await mock.getFeaturedCourses();
|
||||
return courses;
|
||||
const posts = await get<AirtablePost[]>('posts', { tag: 'featured_course' });
|
||||
return posts.map((post) => {
|
||||
return {
|
||||
title: post.title,
|
||||
sub_title: post.sub_title,
|
||||
banner_image_url: post.thumb_image_url,
|
||||
link: post.link
|
||||
} as Course;
|
||||
});
|
||||
}
|
||||
|
||||
export async function getTopPackages(): Promise<GUIPackage[]> {
|
||||
|
|
Loading…
Reference in a new issue