feat: switch to use fetcvhInstanceStats from api composable in auth.vue

This commit is contained in:
SauceyRed 2025-07-09 07:25:10 +02:00
parent 6154bb89d0
commit 9e5d48931d
Signed by: sauceyred
GPG key ID: 2BF92EB6D8A5CCA7

View file

@ -61,10 +61,10 @@ async function selectInstance(e: Event) {
instanceUrl.value = origin;
useCookie("instance_url").value = origin;
console.log("set instance url to:", origin);
const { status, data, error } = await useFetch<StatsResponse>(`${apiBase.value}/stats`);
if (status.value == "success" && data.value) {
registrationEnabled.value = data.value.registration_enabled;
console.log("set registration enabled value to:", data.value.registration_enabled);
const stats = await useApi().fetchInstanceStats(apiBase.value);
if (stats) {
registrationEnabled.value = stats.registration_enabled;
console.log("set registration enabled value to:", stats.registration_enabled);
}
return;
}