From b8f41fe69157cda73af3a9f028cbccb986751821 Mon Sep 17 00:00:00 2001 From: Raymonzut <40148684+Raymonzut@users.noreply.github.com> Date: Sat, 26 Sep 2020 19:10:58 +0200 Subject: [PATCH 1/2] Remove js for posts page --- client/public/lib/remote.mjs | 24 -------------- client/public/posts.html | 10 ------ client/public/posts.mjs | 61 ------------------------------------ 3 files changed, 95 deletions(-) delete mode 100644 client/public/lib/remote.mjs delete mode 100644 client/public/posts.mjs diff --git a/client/public/lib/remote.mjs b/client/public/lib/remote.mjs deleted file mode 100644 index a445c79..0000000 --- a/client/public/lib/remote.mjs +++ /dev/null @@ -1,24 +0,0 @@ -export async function getPosts(id) { - const BASE_URL = 'https://raymon.dev' - const BASE_ENDPOINT = '/api/posts' - const URL = BASE_URL + BASE_ENDPOINT + (id ? `/${id}` : '?sort=-1') - - let posts = [] - - return await fetch(URL) - .then(res => res.json()) - .then(res => { - if (id !== undefined) { - if (res === undefined) { - throw Error("Response body empty") - } - return [res] - } - else { - return res - } - }) - .catch(err => { - console.log(`Error: ${err}`) - }) -} diff --git a/client/public/posts.html b/client/public/posts.html index f44fd78..2944fd5 100644 --- a/client/public/posts.html +++ b/client/public/posts.html @@ -8,9 +8,6 @@