mirror of
https://github.com/ershisan99/coolify.git
synced 2026-01-27 12:34:34 +00:00
29 lines
538 B
Svelte
29 lines
538 B
Svelte
<script context="module" lang="ts">
|
|
import type { Load } from '@sveltejs/kit';
|
|
export const load: Load = async ({ fetch, params }) => {
|
|
const url = `/iam/team/${params.id}.json`;
|
|
const res = await fetch(url);
|
|
if (res.ok) {
|
|
const data = await res.json();
|
|
if (!data.permissions || Object.entries(data.permissions).length === 0) {
|
|
return {
|
|
status: 302,
|
|
redirect: '/iam'
|
|
};
|
|
}
|
|
return {
|
|
stuff: {
|
|
...data
|
|
}
|
|
};
|
|
}
|
|
|
|
return {
|
|
status: 302,
|
|
redirect: '/iam'
|
|
};
|
|
};
|
|
</script>
|
|
|
|
<slot />
|