Skip to content

Commit

Permalink
Use config data from layout instead of pulling separately in +page.js
Browse files Browse the repository at this point in the history
  • Loading branch information
unixfy committed Oct 30, 2024
1 parent a59e3bf commit 98ce25c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/routes/+layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import { readItems } from '@directus/sdk';
export async function load({ fetch }) {
const directus = getDirectusInstance(fetch);
return {
config: await directus.request(readItems('config', { fields: ["banner_enabled", "banner_content"] }))
config: await directus.request(readItems('config', { fields: ["banner_enabled", "banner_content", "sshkey"] }))
}
}
7 changes: 1 addition & 6 deletions src/routes/sshkey/+page.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import getDirectusInstance from "$lib/directus";
import { readItems } from '@directus/sdk';

export async function load({ fetch }) {
const directus = getDirectusInstance(fetch);
export async function load() {
return {
config: await directus.request(readItems('config', { fields: ["sshkey"] })),
title: "SSH Key"
}
}

0 comments on commit 98ce25c

Please sign in to comment.