mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
fix: add store for project team
This commit is contained in:
1 parent
24d7eb9810
commit
0ecc38540f
2 files changed
+20
-7
No files matched your search
@@ -4,7 +4,7 @@
|
||||
import { sdkForConsole, setProject } from '$lib/stores/sdk';
|
||||
import { collection } from './databases/database/[database]/collection/[collection]/store';
|
||||
import { UploadBox } from '$lib/components';
|
||||
import { project } from './store';
|
||||
import { organisation, project } from './store';
|
||||
import { onMount } from 'svelte';
|
||||
import { afterNavigate } from '$app/navigation';
|
||||
import { updateLayout } from '$lib/stores/layout';
|
||||
@@ -50,12 +50,11 @@
|
||||
async function handle(event = null) {
|
||||
if ($project?.$id !== projectId) {
|
||||
setProject(projectId);
|
||||
if (browser) {
|
||||
await project.load(projectId);
|
||||
}
|
||||
await project.load(projectId);
|
||||
}
|
||||
if ($organisation?.$id !== $project.teamId) {
|
||||
await organisation.load($project.teamId);
|
||||
}
|
||||
// TODO: load organization
|
||||
// const organisation = await sdkForConsole.teams.get($project.teamId);
|
||||
|
||||
updateLayout({
|
||||
navigate: event,
|
||||
@@ -64,7 +63,7 @@
|
||||
breadcrumbs: [
|
||||
{
|
||||
href: '#',
|
||||
title: $project.name,
|
||||
title: $organisation.name,
|
||||
level: 1
|
||||
},
|
||||
{
|
||||
|
||||
@@ -15,4 +15,18 @@ function createProject() {
|
||||
};
|
||||
}
|
||||
|
||||
function createOrganisation() {
|
||||
const { subscribe, set } = writable<Models.Team>();
|
||||
|
||||
return {
|
||||
subscribe,
|
||||
set,
|
||||
load: async (teamId: string) => {
|
||||
const team = await sdkForConsole.teams.get(teamId);
|
||||
set(team);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export const project = createProject();
|
||||
export const organisation = createOrganisation();
|
||||
Reference in new issue
Block a user