feat: Consolidate Admin User APIs (#5050)

Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
This commit is contained in:
Michael Genson 2025-06-30 05:13:42 -05:00 committed by GitHub
parent 31f90c79c0
commit 47eb1ebbb1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 24 additions and 53 deletions

View file

@ -1,4 +1,4 @@
import { useUserApi } from "~/composables/api";
import { useAdminApi } from "~/composables/api";
import type { UserIn, UserOut } from "~/lib/api/types/user";
/*
@ -8,7 +8,7 @@ to control whether the object is substantiated... but some of the others rely on
*/
export const useAllUsers = function () {
const api = useUserApi();
const api = useAdminApi();
const asyncKey = String(Date.now());
const { data: users, refresh: refreshAllUsers } = useLazyAsyncData(asyncKey, async () => {
const { data } = await api.users.getAll();
@ -24,7 +24,7 @@ export const useAllUsers = function () {
};
export const useUser = function (refreshFunc: CallableFunction | null = null) {
const api = useUserApi();
const api = useAdminApi();
const loading = ref(false);
function getUser(id: string) {