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