Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export enum Dependencies {
ADDRESS = 'dependency:address',
PAYMENT_METHODS = 'dependency:paymentMethods',
ORGANIZATION = 'dependency:organization',
MEMBERS = 'dependency:members',
PROJECT = 'dependency:project',
PROJECT_VARIABLES = 'dependency:project_variables',
PROJECT_INSTALLATIONS = 'dependency:project_installations',
Expand Down
1 change: 1 addition & 0 deletions src/routes/console/organization-[organization]/+layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { preferences } from '$lib/stores/preferences';

export const load: LayoutLoad = async ({ params, depends }) => {
depends(Dependencies.ORGANIZATION);
depends(Dependencies.MEMBERS);
depends(Dependencies.PAYMENT_METHODS);

if (isCloud) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
);
await invalidate(Dependencies.ACCOUNT);
await invalidate(Dependencies.ORGANIZATION);
await invalidate(Dependencies.MEMBERS);

showCreate = false;
addNotification({
type: 'success',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { base } from '$app/paths';
import { goto } from '$app/navigation';
import { goto, invalidate } from '$app/navigation';
import { Modal } from '$lib/components';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
Expand All @@ -9,6 +9,10 @@
import { createEventDispatcher } from 'svelte';
import { user } from '$lib/stores/user';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Dependencies } from '$lib/constants';
import { checkForUsageLimit } from '$lib/stores/billing';
import { isCloud } from '$lib/system';
import { organization } from '$lib/stores/organization';
const dispatch = createEventDispatcher();
Expand All @@ -25,6 +29,11 @@
} else {
dispatch('deleted');
}
invalidate(Dependencies.ACCOUNT);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to invalidate account?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure but it was there and I'm afraid to remove it 🤣

invalidate(Dependencies.MEMBERS);
if (isCloud && $organization) {
await checkForUsageLimit($organization);
}
showDelete = false;
addNotification({
type: 'success',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { page } from '$app/stores';
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
import { AvatarInitials, PaginationWithLimit } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Pill } from '$lib/elements';
import { Button } from '$lib/elements/forms';
import {
Expand All @@ -29,7 +27,6 @@
let selectedMember: Models.Membership;
let showDelete = false;
const url = `${$page.url.origin}/console/`;
const deleted = () => invalidate(Dependencies.ACCOUNT);
const resend = async (member: Models.Membership) => {
try {
await sdk.forConsole.teams.createMembership(
Expand Down Expand Up @@ -124,4 +121,4 @@
{/if}
</Container>

<Delete {selectedMember} bind:showDelete on:deleted={() => deleted()} />
<Delete {selectedMember} bind:showDelete />
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { PageLoad } from './$types';

export const load: PageLoad = async ({ url, params, route, depends }) => {
depends(Dependencies.ORGANIZATION);
depends(Dependencies.MEMBERS);
const page = getPage(url);
const limit = getLimit(url, route, PAGE_LIMIT);
const offset = pageToOffset(page, limit);
Expand Down