mealie/frontend/composables/api/use-app-info.ts
Hayden ba325c12f7
Fix/fix broken pwa (#1086)
* remove fetch / use axios fix #1077

* revert checkbox change

* add password peek

* fix bool check
2022-03-22 20:41:54 -08:00

17 lines
464 B
TypeScript

import { ref, Ref, useAsync, useContext } from "@nuxtjs/composition-api";
import { useAsyncKey } from "../use-utils";
import { AppInfo } from "~/types/api-types/admin";
export function useAppInfo(): Ref<AppInfo | null> {
const appInfo = ref<null | AppInfo>(null);
const { $axios } = useContext();
useAsync(async () => {
const data = await $axios.get<AppInfo>("/api/app/about");
appInfo.value = data.data;
}, useAsyncKey());
return appInfo;
}