diff --git a/resources/js_vue3/router/middlewares/starter.js b/resources/js_vue3/router/middlewares/starter.js index 8561c925..5f57f089 100644 --- a/resources/js_vue3/router/middlewares/starter.js +++ b/resources/js_vue3/router/middlewares/starter.js @@ -6,7 +6,7 @@ export default function starter({ to, next, stores }) { const { twofaccounts } = stores if (twofaccounts.isEmpty) { - twofaccounts.refresh().then(() => { + twofaccounts.fetch().then(() => { if (twofaccounts.isEmpty) { next({ name: 'start' }); } diff --git a/resources/js_vue3/stores/groups.js b/resources/js_vue3/stores/groups.js index ca343b36..7507247b 100644 --- a/resources/js_vue3/stores/groups.js +++ b/resources/js_vue3/stores/groups.js @@ -22,10 +22,10 @@ export const useGroups = defineStore({ actions: { /** - * Refreshes the groups collection using the backend + * Fetches the groups collection from the backend */ - refresh() { - groupService.getAll().then(response => { + async fetch() { + await groupService.getAll().then(response => { this.items = response.data }) }, diff --git a/resources/js_vue3/stores/twofaccounts.js b/resources/js_vue3/stores/twofaccounts.js index 87a9034e..fe3507a8 100644 --- a/resources/js_vue3/stores/twofaccounts.js +++ b/resources/js_vue3/stores/twofaccounts.js @@ -77,7 +77,7 @@ export const useTwofaccounts = defineStore({ /** * Refreshes the accounts collection using the backend */ - async refresh() { + async fetch() { await twofaccountService.getAll(! useUserStore().preferences.getOtpOnRequest).then(response => { this.items = response.data }) diff --git a/resources/js_vue3/views/Accounts.vue b/resources/js_vue3/views/Accounts.vue index 14894b90..19c0a58b 100644 --- a/resources/js_vue3/views/Accounts.vue +++ b/resources/js_vue3/views/Accounts.vue @@ -58,7 +58,7 @@ // We now check the twofaccounts store state in case the backend data have changed. const isUpToDate = await twofaccounts.isUpToDateWithBackend() if (! isUpToDate) { - await twofaccounts.refresh() + await twofaccounts.fetch() notify.info({ text: trans('commons.data_refreshed_to_reflect_server_changes'), duration: 10000 }) } })