Move working documents to its own area, rename dashboard
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { hasStoredClientSession } from '$lib/session';
|
||||
import { getStoredClientSession, hasModuleAccess, hasStoredClientSession } from '$lib/session';
|
||||
import { api } from '$lib/api';
|
||||
|
||||
export async function load({ fetch }) {
|
||||
@@ -8,9 +8,11 @@ export async function load({ fetch }) {
|
||||
};
|
||||
}
|
||||
|
||||
const session = getStoredClientSession();
|
||||
|
||||
try {
|
||||
return {
|
||||
rawMaterials: await api.rawMaterials(fetch)
|
||||
rawMaterials: hasModuleAccess(session, 'mix_master') && hasModuleAccess(session, 'raw_materials') ? await api.rawMaterials(fetch) : []
|
||||
};
|
||||
} catch {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user