feat: integrate SvelteKit for seamless navigation and improved data loading
This commit is contained in:
23
frontend/src/routes/settings/+page.ts
Normal file
23
frontend/src/routes/settings/+page.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { api } from '../../lib/api';
|
||||
|
||||
/** @type {import('./$types').PageLoad} */
|
||||
export async function load() {
|
||||
try {
|
||||
const settings = await api.getSettings();
|
||||
return {
|
||||
settings
|
||||
};
|
||||
} catch (error) {
|
||||
console.error('Failed to load settings:', error);
|
||||
return {
|
||||
settings: {
|
||||
environments: [],
|
||||
settings: {
|
||||
backup_path: '',
|
||||
default_environment_id: null
|
||||
}
|
||||
},
|
||||
error: 'Failed to load settings'
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user