Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 4db61938 authored by peter_rabbit's avatar peter_rabbit
Browse files

fix broken json

parent 49cc8673
No related branches found
No related tags found
No related merge requests found
["fantom_quest/fantom_quest.json"] {
"articles": ["fantom_quest/fantom_quest.json"]
}
...@@ -117,7 +117,7 @@ function loadArticles(dir_url) { ...@@ -117,7 +117,7 @@ function loadArticles(dir_url) {
fetchjson(`${dir_url}/index.json`) fetchjson(`${dir_url}/index.json`)
.then(json => { .then(json => {
Promise.all( Promise.all(
json.map(async articlePath => { json.articles.map(async articlePath => {
const art = await fetchjson(`${dir_url}/${articlePath}`); const art = await fetchjson(`${dir_url}/${articlePath}`);
const tmpSplit = articlePath.split("/"); const tmpSplit = articlePath.split("/");
tmpSplit.pop(); tmpSplit.pop();
......
...@@ -386,7 +386,7 @@ function loadArticles(dir_url) { ...@@ -386,7 +386,7 @@ function loadArticles(dir_url) {
fetchjson(`${dir_url}/index.json`) fetchjson(`${dir_url}/index.json`)
.then(json => { .then(json => {
Promise.all( Promise.all(
json.map(async articlePath => { json.articles.map(async articlePath => {
const art = await fetchjson(`${dir_url}/${articlePath}`); const art = await fetchjson(`${dir_url}/${articlePath}`);
const tmpSplit = articlePath.split("/"); const tmpSplit = articlePath.split("/");
tmpSplit.pop(); tmpSplit.pop();
......
["test/article-test.json", "nested/article-nested.json"] {
"articles": ["test/article-test.json", "nested/article-nested.json"]
}
[] {
\ No newline at end of file "articles": []
}
...@@ -26,7 +26,7 @@ function loadArticles(dir_url) { ...@@ -26,7 +26,7 @@ function loadArticles(dir_url) {
fetchjson(`${dir_url}/index.json`) fetchjson(`${dir_url}/index.json`)
.then(json => { .then(json => {
Promise.all( Promise.all(
json.map(async articlePath => { json.articles.map(async articlePath => {
const art = await fetchjson(`${dir_url}/${articlePath}`); const art = await fetchjson(`${dir_url}/${articlePath}`);
const tmpSplit = articlePath.split("/"); const tmpSplit = articlePath.split("/");
tmpSplit.pop(); tmpSplit.pop();
......
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