Switches to a global variable for client/serverConfig

This commit is contained in:
2023-08-14 12:37:45 +02:00
parent c531e7231d
commit eb32347990
4 changed files with 73 additions and 36 deletions

View File

@@ -1,13 +1,12 @@
import { clientConfig, serverConfig } from '$lib/server/config';
import { get } from 'svelte/store';
import type { PageServerLoad } from './$types';
import { getServiceHandler } from '$lib/services/services';
export const load: PageServerLoad = ({ fetch }) => {
const config = get(clientConfig);
const serviceData: Array<Array<unknown>> = [];
const config = clientConfig();
for (const [i, group] of get(serverConfig).services.entries()) {
for (const [i, group] of serverConfig().services.entries()) {
const groupData: Array<unknown> = [];
serviceData.push(groupData);
for (const [j, service] of group.items.entries()) {