First
This commit is contained in:
10
frontend/src/routes/clinics/+page.js
Normal file
10
frontend/src/routes/clinics/+page.js
Normal file
@@ -0,0 +1,10 @@
|
||||
/** @type {import('./$types').PageLoad} */
|
||||
export async function load({ params, fetch }) {
|
||||
let clinics = await (await fetch('/api/clinic/list')).json();
|
||||
clinics.reduce((acc, item) => (acc[item.name] = item, acc), clinics);
|
||||
let selection = await (await fetch('/api/config/user/clinics')).json();
|
||||
selection.forEach(x => clinics[x] ? clinics[x].active = true : false);
|
||||
return {
|
||||
clinics
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user