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

12 lines
430 B
TypeScript
Raw Normal View History

import { Ref, useAsync } from "@nuxtjs/composition-api";
import { useAsyncKey } from "../use-utils";
import { AppInfo } from "~/types/api-types/admin";
export function useAppInfo(): Ref<AppInfo | null> {
return useAsync(async () => {
// We use fetch here to reduce need for additional dependencies
const data = await fetch("/api/app/about").then((res) => res.json());
return data as AppInfo;
}, useAsyncKey());
}