mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-20 03:38:06 +02:00
Rename stores method which fetch fresh api data
This commit is contained in:
parent
40ea767799
commit
4fd5559e5f
@ -6,7 +6,7 @@ export default function starter({ to, next, stores }) {
|
|||||||
const { twofaccounts } = stores
|
const { twofaccounts } = stores
|
||||||
|
|
||||||
if (twofaccounts.isEmpty) {
|
if (twofaccounts.isEmpty) {
|
||||||
twofaccounts.refresh().then(() => {
|
twofaccounts.fetch().then(() => {
|
||||||
if (twofaccounts.isEmpty) {
|
if (twofaccounts.isEmpty) {
|
||||||
next({ name: 'start' });
|
next({ name: 'start' });
|
||||||
}
|
}
|
||||||
|
6
resources/js_vue3/stores/groups.js
vendored
6
resources/js_vue3/stores/groups.js
vendored
@ -22,10 +22,10 @@ export const useGroups = defineStore({
|
|||||||
actions: {
|
actions: {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Refreshes the groups collection using the backend
|
* Fetches the groups collection from the backend
|
||||||
*/
|
*/
|
||||||
refresh() {
|
async fetch() {
|
||||||
groupService.getAll().then(response => {
|
await groupService.getAll().then(response => {
|
||||||
this.items = response.data
|
this.items = response.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
2
resources/js_vue3/stores/twofaccounts.js
vendored
2
resources/js_vue3/stores/twofaccounts.js
vendored
@ -77,7 +77,7 @@ export const useTwofaccounts = defineStore({
|
|||||||
/**
|
/**
|
||||||
* Refreshes the accounts collection using the backend
|
* Refreshes the accounts collection using the backend
|
||||||
*/
|
*/
|
||||||
async refresh() {
|
async fetch() {
|
||||||
await twofaccountService.getAll(! useUserStore().preferences.getOtpOnRequest).then(response => {
|
await twofaccountService.getAll(! useUserStore().preferences.getOtpOnRequest).then(response => {
|
||||||
this.items = response.data
|
this.items = response.data
|
||||||
})
|
})
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
// We now check the twofaccounts store state in case the backend data have changed.
|
// We now check the twofaccounts store state in case the backend data have changed.
|
||||||
const isUpToDate = await twofaccounts.isUpToDateWithBackend()
|
const isUpToDate = await twofaccounts.isUpToDateWithBackend()
|
||||||
if (! isUpToDate) {
|
if (! isUpToDate) {
|
||||||
await twofaccounts.refresh()
|
await twofaccounts.fetch()
|
||||||
notify.info({ text: trans('commons.data_refreshed_to_reflect_server_changes'), duration: 10000 })
|
notify.info({ text: trans('commons.data_refreshed_to_reflect_server_changes'), duration: 10000 })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user