Skip to content

Commit

Permalink
Explicitly define page title
Browse files Browse the repository at this point in the history
  • Loading branch information
nas-tabchiche committed Dec 20, 2024
1 parent c968ca2 commit 993f866
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { zod } from 'sveltekit-superforms/adapters';
import type { PageServerLoad } from './$types';
import type { Project } from '$lib/utils/types';
import { TODAY } from '$lib/utils/constants';
import * as m from '$paraglide/messages';

const REQUIREMENT_ASSESSMENT_STATUS = [
'compliant',
Expand Down Expand Up @@ -235,6 +236,7 @@ export const load: PageServerLoad = async ({ locals, fetch }) => {
applied_control_status: applied_control_status.results,
projects,
user: locals.user,
metrics: metrics.results
metrics: metrics.results,
title: m.analytics()
};
};
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { BASE_API_URL } from '$lib/utils/constants';

import type { PageServerLoad } from './$types';
import * as m from '$paraglide/messages';

export const load = (async ({ fetch }) => {
const endpoint = `${BASE_API_URL}/folders/my_assignments/`;

const res = await fetch(endpoint);
const data = await res.json();

return { data };
return { data, title: m.myAssignments() };
}) satisfies PageServerLoad;
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ export const load = (async ({ fetch, params }) => {
.then((res) => res.json())
.then((res) => JSON.parse(res.json_definition));

return { scenario, tables, riskMatrix };
return { scenario, tables, riskMatrix, title: scenario.name };
}) satisfies PageServerLoad;
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@ export const load: PageServerLoad = async ({ fetch, params }) => {
zod(attachmentDeleteSchema)
);

return { URLModel, evidence, object, tables, deleteForm, attachmentDeleteForm };
return {
URLModel,
evidence,
object,
tables,
deleteForm,
attachmentDeleteForm,
title: evidence.name
};
};

export const actions: Actions = {
Expand Down

0 comments on commit 993f866

Please sign in to comment.