fix formatting

This commit is contained in:
maxDorninger
2025-05-25 20:31:48 +02:00
parent 729a7ed647
commit b2dc7a18a6
39 changed files with 855 additions and 832 deletions

View File

@@ -2,32 +2,32 @@ import {env} from '$env/dynamic/public';
import type {PageLoad} from './$types';
export const load: PageLoad = async ({fetch}) => {
try {
const users = await fetch(env.PUBLIC_API_URL + "/users/all", {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
credentials: 'include'
});
try {
const users = await fetch(env.PUBLIC_API_URL + '/users/all', {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
credentials: 'include'
});
if (!users.ok) {
console.error(`Failed to fetch users: ${users.statusText}`);
return {
users: null,
};
}
if (!users.ok) {
console.error(`Failed to fetch users: ${users.statusText}`);
return {
users: null
};
}
const usersData = await users.json();
console.log('Fetched users:', usersData);
const usersData = await users.json();
console.log('Fetched users:', usersData);
return {
users: usersData,
};
} catch (error) {
console.error('Error fetching users:', error);
return {
users: null,
};
}
};
return {
users: usersData
};
} catch (error) {
console.error('Error fetching users:', error);
return {
users: null
};
}
};