diff --git a/resources/js/components/beam/BeamsList.vue b/resources/js/components/beam/BeamsList.vue index 180b371..83e6964 100644 --- a/resources/js/components/beam/BeamsList.vue +++ b/resources/js/components/beam/BeamsList.vue @@ -317,6 +317,7 @@ const getSingleUseCode = async () => { const getBeamCodes = async () => { isLoading.value = true; + await appStore.fetchInternal(); try { const res = await BeamApi.getBeams({ ...formatData(searchInput.value ? { codes: [searchInput.value] } : {}), diff --git a/resources/js/store/index.ts b/resources/js/store/index.ts index f51a10f..8c61cfd 100644 --- a/resources/js/store/index.ts +++ b/resources/js/store/index.ts @@ -197,6 +197,16 @@ export const useAppStore = defineStore('app', { return true; }, + async fetchInternal() { + try { + const internalConfig = await ApiService.fetchInternalUrl(this.config.url!); + if (internalConfig) { + this.internal = true; + } + } catch { + this.internal = false; + } + }, async login(email: string, password: string, recaptcha?: string) { const res = await AuthApi.login(email, password, recaptcha); if (!res.data.Login) {