mealie/frontend/composables/api/use-app-info.ts
Hayden 13e157827c
Fix/fix block registration (#1059)
* fix disable button

* add backend env for restricting registration

* update state management

* add allow_signup to app info

* move allow_signup to backend only

* cleanup docker-compose

* potential darkmode fix

* fix missing variable

* add banner on login page

* use random bools for tests

* fix initial state bug

* fix state reset
2022-03-15 17:34:53 -08:00

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());
}