Skip to content

Commit

Permalink
tryin or cryin
Browse files Browse the repository at this point in the history
  • Loading branch information
allurei committed Dec 19, 2024
1 parent 8984b56 commit 259ff40
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/routes/tesmi/+page.server.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const load = async ({fetch, params }) => {
/* export const load = async ({fetch, params }) => {
const response = await fetch('https://www.asteriski.fi/wp-json/wp/v2/posts?tags=2200&_embed&per_page=4');
if (response.ok) {
Expand All @@ -12,4 +12,4 @@ export const load = async ({fetch, params }) => {
return {
posts: []
};
}
} */
6 changes: 3 additions & 3 deletions src/routes/tesmi/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
import Info from "$lib/components/info.svelte";
import Program from "$lib/components/program.svelte";
import Footer from "$lib/components/footer.svelte";
import Posts from "$lib/components/posts.svelte";
//import Posts from "$lib/components/posts.svelte";
import Menu from "$lib/components/menu.svelte";
import Logofarm from "$lib/components/logofarm.svelte";
export let data;
//export let data;
</script>
<Banner/>
<Program/>
<Info mask={true}/>
<Posts posts={data.posts}/>

<Menu/>
<Logofarm />
<Footer/>
8 changes: 6 additions & 2 deletions src/routes/tesmi/posts/+page.server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
export const load = async ({fetch, params }) => {
const response = await fetch('https://www.asteriski.fi/wp-json/wp/v2/posts?tags=2200&_embed&per_page=4');
export const load = async ({fetch, url }) => {
const response = await fetch('https://www.asteriski.fi/wp-json/wp/v2/posts?tags=2200&_embed&per_page=4', {
headers: {
origin: url.origin
}
});

if (response.ok) {
const data = await response.json();
Expand Down

0 comments on commit 259ff40

Please sign in to comment.