mirror of
https://github.com/ershisan99/coolify.git
synced 2026-01-30 05:02:12 +00:00
fix: Ton of updates for users/teams
This commit is contained in:
28
src/routes/iam/team/[id]/__layout.svelte
Normal file
28
src/routes/iam/team/[id]/__layout.svelte
Normal file
@@ -0,0 +1,28 @@
|
||||
<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 />
|
||||
Reference in New Issue
Block a user