mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: updatePrefs calls using object params.
This commit is contained in:
@@ -35,7 +35,7 @@ function updateNotificationPrefs(parsedPrefs: Record<string, NotificationPrefIte
|
||||
notificationPrefs: parsedPrefs
|
||||
};
|
||||
|
||||
sdk.forConsole.account.updatePrefs(newPrefs);
|
||||
sdk.forConsole.account.updatePrefs({ prefs: newPrefs });
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,5 +26,5 @@ export async function setHasOnboardingDismissed(projectId: string, account?: Acc
|
||||
onboardingDismissed: onboardingDismissed
|
||||
};
|
||||
|
||||
await sdk.forConsole.account.updatePrefs(newPrefs);
|
||||
await sdk.forConsole.account.updatePrefs({ prefs: newPrefs });
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ export function updateSidebarState(page: Page, state: 'closed' | 'open' | 'icons
|
||||
sidebarState: state
|
||||
};
|
||||
|
||||
sdk.forConsole.account.updatePrefs(newPrefs);
|
||||
sdk.forConsole.account.updatePrefs({ prefs: newPrefs });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ export const joinWaitlistSites = (user: Account) => {
|
||||
joinWaitlistSites: true
|
||||
};
|
||||
|
||||
sdk.forConsole.account.updatePrefs(newPrefs);
|
||||
sdk.forConsole.account.updatePrefs({ prefs: newPrefs });
|
||||
|
||||
if (sessionStorage) {
|
||||
sessionStorage.setItem('joinWaitlistSites', 'true');
|
||||
|
||||
@@ -54,7 +54,7 @@ async function updateConsolePreferences(store: ConsolePreferencesStore): Promise
|
||||
...store
|
||||
};
|
||||
|
||||
await sdk.forConsole.account.updatePrefs(currentPreferences);
|
||||
await sdk.forConsole.account.updatePrefs({ prefs: currentPreferences });
|
||||
}
|
||||
|
||||
function createPreferences() {
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
newOnboardingCompleted: true
|
||||
};
|
||||
|
||||
sdk.forConsole.account.updatePrefs(newPrefs);
|
||||
sdk.forConsole.account.updatePrefs({ prefs: newPrefs });
|
||||
}
|
||||
|
||||
async function createProject() {
|
||||
|
||||
@@ -39,7 +39,7 @@ export const load: LayoutLoad = async ({ params, depends, parent }) => {
|
||||
}
|
||||
if (prefs.organization !== params.organization) {
|
||||
const newPrefs = { ...prefs, organization: params.organization };
|
||||
sdk.forConsole.account.updatePrefs(newPrefs);
|
||||
sdk.forConsole.account.updatePrefs({ prefs: newPrefs });
|
||||
}
|
||||
|
||||
const [organization, members, countryList, locale] = await Promise.all([
|
||||
@@ -64,7 +64,7 @@ export const load: LayoutLoad = async ({ params, depends, parent }) => {
|
||||
};
|
||||
} catch (e) {
|
||||
const newPrefs = { ...prefs, organization: null };
|
||||
sdk.forConsole.account.updatePrefs(newPrefs);
|
||||
sdk.forConsole.account.updatePrefs({ prefs: newPrefs });
|
||||
error(e.code, e.message);
|
||||
}
|
||||
};
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
}
|
||||
const prefs = await sdk.forConsole.account.getPrefs();
|
||||
const newPrefs = { ...prefs, organization: null };
|
||||
await sdk.forConsole.account.updatePrefs(newPrefs);
|
||||
await sdk.forConsole.account.updatePrefs({ prefs: newPrefs });
|
||||
if ($organizationList?.total > 1) {
|
||||
await goto(`${base}/account/organizations`);
|
||||
} else {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
const today = new Date().toISOString();
|
||||
const prefs = await sdk.forConsole.account.getPrefs();
|
||||
const newPrefs = { ...prefs, DPA: today };
|
||||
sdk.forConsole.account.updatePrefs(newPrefs);
|
||||
sdk.forConsole.account.updatePrefs({ prefs: newPrefs });
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -48,10 +48,10 @@ export const load: LayoutLoad = async ({ params, depends, parent }) => {
|
||||
const scopes = rolesResult?.scopes ?? defaultScopes;
|
||||
|
||||
if (prefs?.organization !== project.teamId) {
|
||||
sdk.forConsole.account.updatePrefs({
|
||||
sdk.forConsole.account.updatePrefs({ prefs: {
|
||||
...prefs,
|
||||
organization: project.teamId
|
||||
});
|
||||
} });
|
||||
}
|
||||
|
||||
preferences.loadTeamPrefs(project.teamId);
|
||||
|
||||
Reference in New Issue
Block a user