diff --git a/src/routes/(backoffice)/+layout.ts b/src/routes/(backoffice)/+layout.ts
index afb701a..40e205d 100644
--- a/src/routes/(backoffice)/+layout.ts
+++ b/src/routes/(backoffice)/+layout.ts
@@ -1,5 +1,15 @@
import { InitAccountStore } from "$lib/stores";
+import type { LayoutServerLoad } from "../$types";
-export const load = async() => {
- await InitAccountStore();
+export const load: LayoutServerLoad = async ({ locals }) => {
+
+ if(locals?.accoundData){
+ await InitAccountStore(locals.accoundData);
+ }else{
+ await InitAccountStore();
+ }
+
+ return {
+ accountData: locals?.accoundData
+ }
}
\ No newline at end of file
diff --git a/src/routes/(backoffice)/dashboard/+page.server.ts b/src/routes/(backoffice)/dashboard/+page.server.ts
index 9a424fa..dce6d20 100644
--- a/src/routes/(backoffice)/dashboard/+page.server.ts
+++ b/src/routes/(backoffice)/dashboard/+page.server.ts
@@ -1,14 +1,14 @@
import type { PageServerLoad } from "./$types";
import type { LeadData } from "$lib/common/constants/types";
-import { DatabaseService, StorageService } from "$lib/services";
+import { DatabaseService, StorageService, FunctionService } from "$lib/services";
import CONSTANTS from "$lib/common/constants";
export const load: PageServerLoad = async () => {
+ const payload = {};
+ //const functions = await FunctionService.createExecution('userActionControl', JSON.stringify(payload));
+
return {
- leads: await DatabaseService.listDocuments
(
- CONSTANTS.DATABASE_CONFIG.databases.test.id,
- CONSTANTS.DATABASE_CONFIG.databases.test.collections.leads),
- files: await StorageService.listFiles(CONSTANTS.DATABASE_CONFIG.buckets.dev)
+
}
}
\ No newline at end of file
diff --git a/src/routes/(backoffice)/dashboard/+page.svelte b/src/routes/(backoffice)/dashboard/+page.svelte
index 97d4d24..5610390 100644
--- a/src/routes/(backoffice)/dashboard/+page.svelte
+++ b/src/routes/(backoffice)/dashboard/+page.svelte
@@ -1,8 +1,40 @@
+
+
\ No newline at end of file
diff --git a/src/routes/(backoffice)/settings/account/+page.server.ts b/src/routes/(backoffice)/settings/account/+page.server.ts
index ea88944..cb77970 100644
--- a/src/routes/(backoffice)/settings/account/+page.server.ts
+++ b/src/routes/(backoffice)/settings/account/+page.server.ts
@@ -2,8 +2,11 @@ import { superValidate } from "sveltekit-superforms/server";
import type { PageServerLoad } from "./$types";
import { accountFormSchema } from "$lib/features/settings/widgets/forms/account-form.svelte";
import { fail, type Actions } from "@sveltejs/kit";
+import CONSTANTS from "$lib/common/constants";
+import SSRAppwriteClient from "$lib/platforms/appwrite/SSRAppwriteClient";
export const load: PageServerLoad = async () => {
+
return {
form: superValidate(accountFormSchema)
};
@@ -16,6 +19,14 @@ export const actions: Actions = {
return fail(400, {
form
});
+ }else{
+ const jwtToken = event.cookies.get(CONSTANTS.CORE.cookieName);
+ if(jwtToken){
+ const ssrClient = SSRAppwriteClient.getInstance(jwtToken);
+ const response = await ssrClient.account.updateName(form.data.name);
+ console.log("response", response);
+ }
+
}
return {
form
diff --git a/src/routes/+layout.server.ts b/src/routes/+layout.server.ts
new file mode 100644
index 0000000..e7e348e
--- /dev/null
+++ b/src/routes/+layout.server.ts
@@ -0,0 +1,7 @@
+import type { LayoutServerLoad } from "./$types";
+
+export const load: LayoutServerLoad = async ({ locals }) => {
+ return {
+
+ }
+}
\ No newline at end of file
diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts
index 1d39581..0c6d372 100644
--- a/src/routes/+layout.ts
+++ b/src/routes/+layout.ts
@@ -1,27 +1,22 @@
import { InitAccountStore, AccountStore } from "$lib/stores";
import { CheckIfUserIsLoggedIn } from "$lib/common/utils";
import { UpdateDebugStore } from "$lib/ui/widgets/debug-bar/store/DebugStore.js";
-import { DebugStore } from "$lib/ui/widgets/debug-bar/store/DebugStore.js";
import { get } from "svelte/store";
-export async function load({parent}){
- let start = performance.now();
+export async function load({ }){
await InitAccountStore();
const accountData = get(AccountStore);
if(accountData){
}
CheckIfUserIsLoggedIn(accountData);
- let end = performance.now();
-
- let responseTime = end -start;
const debugStoreData = {
route: {
currentRoute: '',
},
vitals: {
- executionTime: responseTime,
+ executionTime: 0,
memoryUsage: 120
},
request: {