mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-20 13:49:40 +02:00
12 lines
430 B
TypeScript
12 lines
430 B
TypeScript
|
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());
|
||
|
}
|