Show registration button if registration allow list is used and improve
registration page Closes #1102 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
GEOCODING_AUTOCOMPLETE,
|
||||
LOCATION,
|
||||
MAPS_TILES,
|
||||
REGISTRATIONS,
|
||||
RESOURCE_PROVIDERS,
|
||||
RESTRICTIONS,
|
||||
ROUTING_TYPE,
|
||||
@@ -204,3 +205,23 @@ export function useSearchConfig() {
|
||||
const searchConfig = computed(() => result.value?.config.search);
|
||||
return { searchConfig, error, loading, onResult };
|
||||
}
|
||||
|
||||
export function useRegistrationConfig() {
|
||||
const { result, error, loading, onResult } = useQuery<{
|
||||
config: Pick<IConfig, "registrationsOpen" | "registrationsAllowlist">;
|
||||
}>(REGISTRATIONS, undefined, { fetchPolicy: "cache-only" });
|
||||
|
||||
const registrationsOpen = computed(
|
||||
() => result.value?.config.registrationsOpen
|
||||
);
|
||||
const registrationsAllowlist = computed(
|
||||
() => result.value?.config.registrationsAllowlist
|
||||
);
|
||||
return {
|
||||
registrationsOpen,
|
||||
registrationsAllowlist,
|
||||
error,
|
||||
loading,
|
||||
onResult,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user