mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
Merge pull request #107 from appwrite/fix-state-dependencies
fix: state dependencies
This commit is contained in:
3 files changed
+34
-31
No files matched your search
+30
-29
@@ -1,35 +1,36 @@
|
||||
export const PAGE_LIMIT = 12; // default page limit
|
||||
export const CARD_LIMIT = 6; // default card limit
|
||||
export enum Dependencies {
|
||||
PROJECT = 'project',
|
||||
PROJECTS = 'projects',
|
||||
ACCOUNT = 'account',
|
||||
ACCOUNT_SESSIONS = 'account_sessions',
|
||||
USER = 'user',
|
||||
USERS = 'users',
|
||||
SESSIONS = 'sessions',
|
||||
TEAM = 'team',
|
||||
TEAMS = 'teams',
|
||||
MEMBERSHIPS = 'memberships',
|
||||
DATABASE = 'database',
|
||||
COLLECTION = 'collection',
|
||||
DOCUMENT = 'document',
|
||||
DOCUMENTS = 'documents',
|
||||
BUCKET = 'bucket',
|
||||
FILE = 'file',
|
||||
FILES = 'files',
|
||||
FUNCTION = 'function',
|
||||
FUNCTIONS = 'functions',
|
||||
VARIABLES = 'variables',
|
||||
DEPLOYMENTS = 'deployments',
|
||||
EXECUTIONS = 'executions',
|
||||
PLATFORM = 'platform',
|
||||
PLATFORMS = 'platforms',
|
||||
KEY = 'key',
|
||||
KEYS = 'keys',
|
||||
DOMAINS = 'domains',
|
||||
WEBHOOK = 'webhook',
|
||||
WEBHOOKS = 'webhooks'
|
||||
ORGANIZATION = 'dependency:organization',
|
||||
PROJECT = 'dependency:project',
|
||||
PROJECTS = 'dependency:projects',
|
||||
ACCOUNT = 'dependency:account',
|
||||
ACCOUNT_SESSIONS = 'dependency:account_sessions',
|
||||
USER = 'dependency:user',
|
||||
USERS = 'dependency:users',
|
||||
SESSIONS = 'dependency:sessions',
|
||||
TEAM = 'dependency:team',
|
||||
TEAMS = 'dependency:teams',
|
||||
MEMBERSHIPS = 'dependency:memberships',
|
||||
DATABASE = 'dependency:database',
|
||||
COLLECTION = 'dependency:collection',
|
||||
DOCUMENT = 'dependency:document',
|
||||
DOCUMENTS = 'dependency:documents',
|
||||
BUCKET = 'dependency:bucket',
|
||||
FILE = 'dependency:file',
|
||||
FILES = 'dependency:files',
|
||||
FUNCTION = 'dependency:function',
|
||||
FUNCTIONS = 'dependency:functions',
|
||||
VARIABLES = 'dependency:variables',
|
||||
DEPLOYMENTS = 'dependency:deployments',
|
||||
EXECUTIONS = 'dependency:executions',
|
||||
PLATFORM = 'dependency:platform',
|
||||
PLATFORMS = 'dependency:platforms',
|
||||
KEY = 'dependency:key',
|
||||
KEYS = 'dependency:keys',
|
||||
DOMAINS = 'dependency:domains',
|
||||
WEBHOOK = 'dependency:webhook',
|
||||
WEBHOOKS = 'dependency:webhooks'
|
||||
}
|
||||
|
||||
export const scopes = [
|
||||
|
||||
@@ -3,9 +3,11 @@ import Breadcrumbs from './breadcrumbs.svelte';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import type { LayoutLoad } from './$types';
|
||||
import { error } from '@sveltejs/kit';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
|
||||
export const load: LayoutLoad = async ({ params, parent }) => {
|
||||
export const load: LayoutLoad = async ({ params, parent, depends }) => {
|
||||
await parent();
|
||||
depends(Dependencies.ORGANIZATION);
|
||||
|
||||
try {
|
||||
return {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
async function updateName() {
|
||||
try {
|
||||
await sdkForConsole.teams.update($organization.$id, name);
|
||||
await invalidate(Dependencies.ACCOUNT);
|
||||
await invalidate(Dependencies.ORGANIZATION);
|
||||
addNotification({
|
||||
message: 'Name has been updated',
|
||||
type: 'success'
|
||||
|
||||
Reference in new issue
Block a user