aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-12-14 12:52:26 -0800
committerFuwn <[email protected]>2023-12-14 12:52:26 -0800
commitc4267cce67e7de6dea2277ce07b6f9a22d8ca674 (patch)
treec1279a47204ea7359937b469f61e48deb3c64747 /src
parentstyle(stores): simplify statements (diff)
downloaddue.moe-c4267cce67e7de6dea2277ce07b6f9a22d8ca674.tar.xz
due.moe-c4267cce67e7de6dea2277ce07b6f9a22d8ca674.zip
feat(api): nest routes
Diffstat (limited to 'src')
-rw-r--r--src/lib/List/Manga/MangaListTemplate.svelte2
-rw-r--r--src/lib/Media/anime.ts2
-rw-r--r--src/routes/+layout.svelte4
-rw-r--r--src/routes/api/anilist/increment/+server.ts (renamed from src/routes/api/anilist-increment/+server.ts)0
-rw-r--r--src/routes/api/authentication/log-out/+server.ts (renamed from src/routes/api/authentication-log-out/+server.ts)0
5 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/List/Manga/MangaListTemplate.svelte b/src/lib/List/Manga/MangaListTemplate.svelte
index aac5928d..b0179ca1 100644
--- a/src/lib/List/Manga/MangaListTemplate.svelte
+++ b/src/lib/List/Manga/MangaListTemplate.svelte
@@ -131,7 +131,7 @@
lastUpdatedMedia = id;
await chapterDatabase.chapters.delete(id);
- await fetch(`/api/anilist-increment?id=${id}&progress=${(progress || 0) + 1}`).then(() => {
+ await fetch(`/api/anilist/increment?id=${id}&progress=${(progress || 0) + 1}`).then(() => {
previousMangaList = media;
const foundEntry = media.find((m) => m.id === id);
diff --git a/src/lib/Media/anime.ts b/src/lib/Media/anime.ts
index 0cc854e7..5004a33b 100644
--- a/src/lib/Media/anime.ts
+++ b/src/lib/Media/anime.ts
@@ -9,7 +9,7 @@ export const cleanCache = (user: AniListAuthorisation, identity: UserIdentity) =
mediaListCollection(user, identity, Type.Anime, get(anime), get(lastPruneTimes).anime, true);
export const updateMedia = (id: number, progress: number | undefined, callback: () => void) => {
- fetch(`/api/anilist-increment?id=${id}&progress=${(progress || 0) + 1}`).then(callback);
+ fetch(`/api/anilist/increment?id=${id}&progress=${(progress || 0) + 1}`).then(callback);
};
export const totalEpisodes = (anime: Media) =>
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 2374ff8e..881e50f4 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -39,7 +39,7 @@
>Log in</a
>
{:else}
- <a href="/api/authentication-log-out">Log out ({currentUserIdentity.name})</a>
+ <a href="/api/authentication/log-out">Log out ({currentUserIdentity.name})</a>
{/if}
</div>
{:else}
@@ -55,7 +55,7 @@
Log in with AniList
</a>
{:else}
- <a href="/api/authentication-log-out">Log out from AniList ({currentUserIdentity.name})</a>
+ <a href="/api/authentication/log-out">Log out from AniList ({currentUserIdentity.name})</a>
{/if}
<p />
diff --git a/src/routes/api/anilist-increment/+server.ts b/src/routes/api/anilist/increment/+server.ts
index 4680236b..4680236b 100644
--- a/src/routes/api/anilist-increment/+server.ts
+++ b/src/routes/api/anilist/increment/+server.ts
diff --git a/src/routes/api/authentication-log-out/+server.ts b/src/routes/api/authentication/log-out/+server.ts
index 22ef49d8..22ef49d8 100644
--- a/src/routes/api/authentication-log-out/+server.ts
+++ b/src/routes/api/authentication/log-out/+server.ts