mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fixes
This commit is contained in:
@@ -11,7 +11,6 @@ import ProjectsAtRisk from '$lib/components/billing/alerts/projectsAtRisk.svelte
|
||||
import { get } from 'svelte/store';
|
||||
import { preferences } from '$lib/stores/preferences';
|
||||
import type { Organization } from '$lib/stores/organization';
|
||||
import { canSeeBilling } from '$lib/stores/roles';
|
||||
|
||||
export const load: LayoutLoad = async ({ params, depends }) => {
|
||||
depends(Dependencies.ORGANIZATION);
|
||||
@@ -22,7 +21,10 @@ export const load: LayoutLoad = async ({ params, depends }) => {
|
||||
|
||||
try {
|
||||
if (isCloud) {
|
||||
if (get(canSeeBilling)) {
|
||||
const res = await sdk.forConsole.billing.getRoles(params.organization);
|
||||
roles = res.roles;
|
||||
scopes = res.scopes;
|
||||
if (scopes.includes('billing.read')) {
|
||||
await failedInvoice.load(params.organization);
|
||||
if (get(failedInvoice)) {
|
||||
headerAlert.add({
|
||||
@@ -33,10 +35,6 @@ export const load: LayoutLoad = async ({ params, depends }) => {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const res = await sdk.forConsole.billing.getRoles(params.organization);
|
||||
roles = res.roles;
|
||||
scopes = res.scopes;
|
||||
}
|
||||
const prefs = await sdk.forConsole.account.getPrefs();
|
||||
if (prefs.organization !== params.organization) {
|
||||
|
||||
@@ -21,12 +21,12 @@ export const load: LayoutLoad = async ({ params, depends }) => {
|
||||
let roles = [];
|
||||
let scopes = [];
|
||||
if (isCloud) {
|
||||
if (get(canSeeBilling)) {
|
||||
await failedInvoice.load(project.teamId);
|
||||
}
|
||||
const res = await sdk.forConsole.billing.getRoles(project.teamId);
|
||||
roles = res.roles;
|
||||
scopes = res.scopes;
|
||||
if (scopes.includes('billing.read')) {
|
||||
await failedInvoice.load(project.teamId);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user