Skip to content

Commit

Permalink
動くと思うからとりあえずリリースしようぜ
Browse files Browse the repository at this point in the history
  • Loading branch information
yanorei32 committed Jun 30, 2024
1 parent 979eb2b commit b474587
Showing 1 changed file with 31 additions and 12 deletions.
43 changes: 31 additions & 12 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,19 +254,38 @@
a = articles[articleIndex];
}

fetch(`https://blog.ksrgte.ch/api/article/${a.id}`)
.then(response => response.text())
.then(data => {
resolve({
article: { title: a.id, body: data },
links: {
next: 0 < articleIndex ?
`/?article=${articles[articleIndex-1].title}` : null,
prev: articleIndex+1 < articles.length ?
`/?article=${articles[articleIndex+1].title}` : null,
},
since: since,
articleTree: articleTree,
articleSpecified: articleSpecified,
});
})
.catch((v) => {
resolve({
article: { title: v.message, body: "らぎサーバーから情報を取得できません。\n\nらぎがわるいかも。" },
links: {
next: 0 < articleIndex ?
`/?article=${articles[articleIndex-1].title}` : null,
prev: articleIndex+1 < articles.length ?
`/?article=${articles[articleIndex+1].title}` : null,
},
since: since,
articleTree: articleTree,
articleSpecified: articleSpecified,
});
});


resolve({
article: a,
links: {
next: 0 < articleIndex ?
`/?article=${articles[articleIndex-1].title}` : null,
prev: articleIndex+1 < articles.length ?
`/?article=${articles[articleIndex+1].title}` : null,
},
since: since,
articleTree: articleTree,
articleSpecified: articleSpecified,
});
}).catch((v) => {
resolve({
article: { title: v.message, body: "らぎサーバーから情報を取得できません。\n\nらぎがわるいかも。" },
Expand Down

0 comments on commit b474587

Please sign in to comment.