Skip to content

Commit

Permalink
fix internal beams query
Browse files Browse the repository at this point in the history
  • Loading branch information
zlayine committed Jun 7, 2024
1 parent 71bf9f7 commit ed9e254
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions resources/js/components/beam/BeamsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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] } : {}),
Expand Down
10 changes: 10 additions & 0 deletions resources/js/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ed9e254

Please sign in to comment.