1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-20 13:49:40 +02:00
mealie/frontend/composables/api/use-app-info.ts

18 lines
496 B
TypeScript
Raw Normal View History

import { useAsyncKey } from "../use-utils";
import type { AppInfo } from "~/lib/api/types/admin";
export function useAppInfo(): Ref<AppInfo | null> {
2022-03-15 19:31:45 -08:00
const appInfo = ref<null | AppInfo>(null);
const i18n = useI18n();
const { $axios } = useNuxtApp();
$axios.defaults.headers.common["Accept-Language"] = i18n.locale.value;
useAsyncData(useAsyncKey(), async () => {
const data = await $axios.get<AppInfo>("/api/app/about");
appInfo.value = data.data;
});
2022-03-15 19:31:45 -08:00
return appInfo;
}