aboutsummaryrefslogtreecommitdiff
path: root/pages/en/manga
diff options
context:
space:
mode:
authorFactiven <[email protected]>2023-07-17 01:22:19 +0000
committerFactiven <[email protected]>2023-07-17 01:22:19 +0000
commitcfc62a497afe132601f6400f0956b5a97775eb54 (patch)
tree0eab20ffe81d29a0ea87822dbd7073614935aa73 /pages/en/manga
parentUpdate README.md (diff)
downloadmoopa-cfc62a497afe132601f6400f0956b5a97775eb54.tar.xz
moopa-cfc62a497afe132601f6400f0956b5a97775eb54.zip
added fallback if no API key provided
Diffstat (limited to 'pages/en/manga')
-rw-r--r--pages/en/manga/[id].js8
-rw-r--r--pages/en/manga/read/[...params].js5
2 files changed, 12 insertions, 1 deletions
diff --git a/pages/en/manga/[id].js b/pages/en/manga/[id].js
index 5e46599..eb53a93 100644
--- a/pages/en/manga/[id].js
+++ b/pages/en/manga/[id].js
@@ -159,7 +159,13 @@ export async function getServerSideProps(context) {
`https://api.anify.tv/chapters/${id}?apikey=${key}`
);
const data2 = await res2.json();
- chapter = data2;
+ if (data2.error) {
+ return {
+ notFound: true
+ }
+ } else {
+ chapter = data2;
+ }
}
return {
diff --git a/pages/en/manga/read/[...params].js b/pages/en/manga/read/[...params].js
index 0c6372d..dbabb3d 100644
--- a/pages/en/manga/read/[...params].js
+++ b/pages/en/manga/read/[...params].js
@@ -251,6 +251,11 @@ export async function getServerSideProps(context) {
);
const data = await res.json();
+ if (data.error) {
+ return {
+ notFound: true
+ }
+ }
return {
props: {