Skip to content

Commit

Permalink
chore(lint): fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
TwistTheNeil committed Feb 20, 2024
1 parent d6bd00c commit bffd49b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/SearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
const queryString: Ref<string> = ref('');
watch(data, () => {
if (queryString.value !== data.value.IP) {
if (queryString.value !== data.value!.IP) {
queryString.value = '';
}
});
Expand Down
12 changes: 4 additions & 8 deletions frontend/src/composables/useFetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,13 @@ export async function getMaxmindData(ipAddress?: string): Promise<{ data: Ref<Ma
return { data, error };
};

export async function getConfig(): Promise<{ data: ConfigBackendResponse, error: string | null }> {
let data: ConfigBackendResponse;
const error: string = ref(null);

export async function getConfig(): Promise<{ data: ConfigBackendResponse | null, error: string | null }> {
try {
const fetchPromise = await fetch("/api/config");
data = await fetchPromise.json();
const data: ConfigBackendResponse = await fetchPromise.json();
return { data, error: null };
} catch (err: any) {
error.value = err.message;
return { data: null, error: err.message };
}

return { data, error };
};

4 changes: 2 additions & 2 deletions frontend/src/stores/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export const useConfigStore = defineStore('config', () => {
async function $reset() {
// TODO: error?
const { data, error } = await getConfig();
maptilerToken.value = data.MaptilerToken;
adminNotice.value = data.AdminNotice;
maptilerToken.value = data!.MaptilerToken;
adminNotice.value = data!.AdminNotice;
};

return {
Expand Down

0 comments on commit bffd49b

Please sign in to comment.