21 lines
350 B
TypeScript
21 lines
350 B
TypeScript
import { hasStoredClientSession } from '$lib/session';
|
|
import { api } from '$lib/api';
|
|
|
|
export async function load({ fetch }) {
|
|
if (!hasStoredClientSession()) {
|
|
return {
|
|
rawMaterials: []
|
|
};
|
|
}
|
|
|
|
try {
|
|
return {
|
|
rawMaterials: await api.rawMaterials(fetch)
|
|
};
|
|
} catch {
|
|
return {
|
|
rawMaterials: []
|
|
};
|
|
}
|
|
}
|