From 4d0e7be92dea27f3974e11b1128411b719b464b2 Mon Sep 17 00:00:00 2001 From: Suvodip Ghosh Date: Sat, 25 Feb 2023 21:51:31 +0530 Subject: [PATCH] audio-book-data-source --- src/components/ThemesAudioBook.vue | 21 ++- src/components/ThemesAudioBookID.vue | 201 +++++++++++++++++++++ src/components/ThemesVideos.astro | 251 --------------------------- src/pages/themes/[id].astro | 8 +- 4 files changed, 218 insertions(+), 263 deletions(-) create mode 100644 src/components/ThemesAudioBookID.vue delete mode 100644 src/components/ThemesVideos.astro diff --git a/src/components/ThemesAudioBook.vue b/src/components/ThemesAudioBook.vue index 99c1d99..dfb786d 100644 --- a/src/components/ThemesAudioBook.vue +++ b/src/components/ThemesAudioBook.vue @@ -55,8 +55,7 @@ export default { } }, - mounted: function () { - // this.getVideos() + mounted: function () { fetch('https://management.beanstalkedu.com/items/themes?filter[status][_eq]=published') .then(response => response.json()) .then(data => { @@ -65,13 +64,19 @@ export default { // console.log(this.page[0].id) return this.page[0].id }) - fetch('https://management.beanstalkedu.com/items/theme_audio_book') - .then(resp => resp.json()) - .then(audiobooks => { - this.audiobooks=audiobooks.data.reverse().slice(0, 3) - // console.log(this.audiobooks) + .then((themesID) => { + fetch('https://management.beanstalkedu.com/items/theme_audio_book?filter[theme_key][_in]='+ themesID) + .then(resp => resp.json()) + .then(audiobooks => { + this.audiobooks=audiobooks.data.reverse().slice(0, 4) + // console.log(this.videos) + }) + return themesID }) - } + + + + } } diff --git a/src/components/ThemesAudioBookID.vue b/src/components/ThemesAudioBookID.vue new file mode 100644 index 0000000..c59f4ad --- /dev/null +++ b/src/components/ThemesAudioBookID.vue @@ -0,0 +1,201 @@ + + + + diff --git a/src/components/ThemesVideos.astro b/src/components/ThemesVideos.astro deleted file mode 100644 index acfd830..0000000 --- a/src/components/ThemesVideos.astro +++ /dev/null @@ -1,251 +0,0 @@ ---- -const {var1} = Astro.props; ---- - - - \ No newline at end of file diff --git a/src/pages/themes/[id].astro b/src/pages/themes/[id].astro index 3407bc6..e3f4285 100644 --- a/src/pages/themes/[id].astro +++ b/src/pages/themes/[id].astro @@ -27,8 +27,8 @@ const twsRespJson = await twsResp.json(); const twsRespData = twsRespJson.data.reverse().slice(0, 3); const twsRespData2 = twsRespJson.data[3]; -import ThemesVideos from "../../components/ThemesVideosID.vue"; -import ThemesAudioBook from "../../components/ThemesAudioBook.vue"; +import ThemesVideosID from "../../components/ThemesVideosID.vue"; +import ThemesAudioBookID from "../../components/ThemesAudioBookID.vue"; const tcsResp = await fetch('https://management.beanstalkedu.com/items/theme_celebration_stories?filter[theme_key][_in]=' + thisThemesID); const tcsRespJson = await tcsResp.json(); @@ -124,8 +124,8 @@ import Footer from "../../components/Footer.vue"; - - + +