From eca61c975eca27df0c310458ebe2970b37bfee70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Jaenisch?= Date: Fri, 14 Jun 2024 18:25:28 +0200 Subject: [PATCH] refactor: turn ap.js into a directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The file has grown and I want to break it apart into smaller files. Therefore I rename the file in the first step and adjust the import paths. Signed-off-by: André Jaenisch --- src/lib/server/{ap.js => ap/index.js} | 2 +- src/routes/account/login/+page.server.js | 2 +- src/routes/profile/+page.server.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename src/lib/server/{ap.js => ap/index.js} (99%) diff --git a/src/lib/server/ap.js b/src/lib/server/ap/index.js similarity index 99% rename from src/lib/server/ap.js rename to src/lib/server/ap/index.js index dfdad34..4ace98a 100644 --- a/src/lib/server/ap.js +++ b/src/lib/server/ap/index.js @@ -15,7 +15,7 @@ import { Agent } from 'node:https'; import axios, { AxiosHeaders } from 'axios'; import * as cheerio from 'cheerio'; -import pkg from '../../../package.json'; +import pkg from '../../../../package.json'; const loginResponse = { id: '87bcb6de-bb70-11ee-b719-6756da82e80f', diff --git a/src/routes/account/login/+page.server.js b/src/routes/account/login/+page.server.js index eb824a2..2031123 100644 --- a/src/routes/account/login/+page.server.js +++ b/src/routes/account/login/+page.server.js @@ -12,7 +12,7 @@ import { fail, redirect } from '@sveltejs/kit'; -import { requests } from '$lib/server/ap.js'; +import { requests } from '$lib/server/ap/index.js'; /** @type {import('./$types').Actions} */ export const actions = { diff --git a/src/routes/profile/+page.server.js b/src/routes/profile/+page.server.js index f80cef7..77d3df2 100644 --- a/src/routes/profile/+page.server.js +++ b/src/routes/profile/+page.server.js @@ -10,7 +10,7 @@ * You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -import { requests } from '$lib/server/ap.js'; +import { requests } from '$lib/server/ap/index.js'; /** @type {import('./$types').PageServerLoad} */ export async function load({ params }) {