Skip to content

Commit

Permalink
Await parent before fetching (#1794)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Tideman authored Jan 11, 2024
1 parent e22eff2 commit afb3eaa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/routes/(app)/namespaces/[namespace]/+layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import { allSearchAttributes } from '$lib/stores/search-attributes';

export const load: LayoutLoad = async ({
params,
parent,
fetch,
}): Promise<LayoutData> => {
await parent();
const attributes = await fetchSearchAttributesForNamespace(
params.namespace,
fetch,
Expand Down
3 changes: 2 additions & 1 deletion src/routes/(app)/namespaces/[namespace]/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import type { PageLoad } from './$types';
import { fetchNamespace } from '$lib/services/namespaces-service';
import { getClusters } from '$lib/utilities/get-clusters';

export const load: PageLoad = async function ({ params, url }) {
export const load: PageLoad = async function ({ params, parent, url }) {
const { searchParams } = url;

if (searchParams.has('time-range')) searchParams.delete('time-range');

await parent();
const namespace = await fetchNamespace(params.namespace);
const clusters = getClusters(namespace);

Expand Down

0 comments on commit afb3eaa

Please sign in to comment.