From 0d9729a92bc1f0372949c4b01ffc5a5e3d1691ef Mon Sep 17 00:00:00 2001 From: nmelhado <39418000+nmelhado@users.noreply.github.com> Date: Mon, 16 Aug 2021 22:45:11 -0400 Subject: [PATCH] fix circular dependency (#42) --- src/routes/api/checkGlobalVersion.js | 8 ++++++++ src/routes/api/checkVersion.js | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 src/routes/api/checkGlobalVersion.js diff --git a/src/routes/api/checkGlobalVersion.js b/src/routes/api/checkGlobalVersion.js new file mode 100644 index 000000000..d95b202e0 --- /dev/null +++ b/src/routes/api/checkGlobalVersion.js @@ -0,0 +1,8 @@ +import {version} from '$lib/version'; + +export async function get() { + return { + status: 200, + body: JSON.stringify(version) + }; +} diff --git a/src/routes/api/checkVersion.js b/src/routes/api/checkVersion.js index 4d1a8ab6f..028eae435 100644 --- a/src/routes/api/checkVersion.js +++ b/src/routes/api/checkVersion.js @@ -1,7 +1,7 @@ import {version} from '$lib/version'; export async function get() { - const res = await fetch('https://league-page.nmelhado.com/api/checkVersion', {compress: true}) + const res = await fetch('https://league-page.nmelhado.com/api/checkGlobalVersion', {compress: true}) let needsUpdate = false; if(res.ok) { const globalVersion = await res.json();