]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs: move preferences from parameter to state (#1137)
authorhafdon <39073287+hafdon@users.noreply.github.com>
Fri, 11 Mar 2022 18:56:50 +0000 (11:56 -0700)
committerGitHub <noreply@github.com>
Fri, 11 Mar 2022 18:56:50 +0000 (19:56 +0100)
packages/docs/core-concepts/actions.md

index a627e22f0b0ee63df73da501ba74c6f4a9baea63..7b5a6426324e21b038d84eac50aa44ebc7747345 100644 (file)
@@ -76,10 +76,11 @@ import { useAuthStore } from './auth-store'
 
 export const useSettingsStore = defineStore('settings', {
   state: () => ({
+    preferences: null,
     // ...
   }),
   actions: {
-    async fetchUserPreferences(preferences) {
+    async fetchUserPreferences() {
       const auth = useAuthStore()
       if (auth.isAuthenticated) {
         this.preferences = await fetchPreferences()