refactor(web): combine api and serverApi (#1833)

This commit is contained in:
Michel Heusschen
2023-02-23 03:49:13 +01:00
committed by GitHub
parent 10cb612fb1
commit 5c86e13239
13 changed files with 32 additions and 31 deletions

View File

@@ -1,5 +1,5 @@
export const prerender = false;
import { serverApi } from '@api';
import { api } from '@api';
import { redirect } from '@sveltejs/kit';
import type { PageServerLoad } from './$types';
@@ -9,7 +9,7 @@ export const load: PageServerLoad = async ({ parent }) => {
throw redirect(302, '/photos');
}
const { data } = await serverApi.userApi.getUserCount(true);
const { data } = await api.userApi.getUserCount(true);
if (data.userCount > 0) {
// Redirect to login page if an admin is already registered.