mirror of
https://github.com/kevin-DL/sapper-template.git
synced 2026-01-22 06:15:18 +00:00
use fetch, tidy up
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
// is called [slug].html
|
||||
const { slug } = params;
|
||||
|
||||
return fetch(`blog/${slug}.json`).then(r => r.json()).then(post => {
|
||||
return this.fetch(`blog/${slug}.json`).then(r => r.json()).then(post => {
|
||||
return { post };
|
||||
});
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
},
|
||||
|
||||
preload({ params, query }) {
|
||||
return fetch(`blog.json`).then(r => r.json()).then(posts => {
|
||||
return this.fetch(`blog.json`).then(r => r.json()).then(posts => {
|
||||
return { posts };
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user