feat: switch to use fetcvhInstanceStats from api composable in auth.vue
This commit is contained in:
parent
6154bb89d0
commit
9e5d48931d
1 changed files with 4 additions and 4 deletions
|
@ -61,10 +61,10 @@ async function selectInstance(e: Event) {
|
||||||
instanceUrl.value = origin;
|
instanceUrl.value = origin;
|
||||||
useCookie("instance_url").value = origin;
|
useCookie("instance_url").value = origin;
|
||||||
console.log("set instance url to:", origin);
|
console.log("set instance url to:", origin);
|
||||||
const { status, data, error } = await useFetch<StatsResponse>(`${apiBase.value}/stats`);
|
const stats = await useApi().fetchInstanceStats(apiBase.value);
|
||||||
if (status.value == "success" && data.value) {
|
if (stats) {
|
||||||
registrationEnabled.value = data.value.registration_enabled;
|
registrationEnabled.value = stats.registration_enabled;
|
||||||
console.log("set registration enabled value to:", data.value.registration_enabled);
|
console.log("set registration enabled value to:", stats.registration_enabled);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue