Skip to content
Snippets Groups Projects
Commit 0c85f090 authored by David Trattnig's avatar David Trattnig
Browse files

refact: settings for category list

parent 486aa090
No related branches found
No related tags found
1 merge request!1Local settings via JSON and initial use of Context API
...@@ -12,8 +12,5 @@ ...@@ -12,8 +12,5 @@
"programmeDaily": "daily", "programmeDaily": "daily",
"trackservice": "trackservice" "trackservice": "trackservice"
} }
},
"components": {
"programme": {}
} }
} }
\ No newline at end of file
<script lang="ts"> <script lang="ts">
import { onMount } from 'svelte' import { onMount } from 'svelte'
import Spinner from '../common/Spinner.svelte' import Spinner from '../common/Spinner.svelte'
import { fetchApi, shuffle } from '../common/Common.svelte' import { settings, fetchApi, shuffle } from '../common/Common.svelte'
import CategoryCard from '../cards/CategoryCard.svelte' import CategoryCard from '../cards/CategoryCard.svelte'
export let api: string = 'https://prog-info.o94.at/api.php'
export let endpointCategories: string = 'categories'
export let categoriesToDisplay: [] // Default: Display all categories export let categoriesToDisplay: [] // Default: Display all categories
export let shuffleCategories: boolean = false export let shuffleCategories: boolean = false
/* Nested props */ /* Nested props */
...@@ -16,7 +14,7 @@ ...@@ -16,7 +14,7 @@
/* Initialize the component */ /* Initialize the component */
onMount(() => { onMount(() => {
let episodeUrl = `${api}/${endpointCategories}/` let episodeUrl = `${settings.api.url}/${settings.api.endpoints.category}/`
console.log('Categories API Url:' + episodeUrl) console.log('Categories API Url:' + episodeUrl)
fetchApi(episodeUrl, processResponse) fetchApi(episodeUrl, processResponse)
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment