From 91f0bd7a2c3248b7de806c9f16715ef0a6f010d8 Mon Sep 17 00:00:00 2001 From: Louis Charette Date: Mon, 13 Jan 2025 20:36:06 -0500 Subject: [PATCH] Add documentation --- .../app/assets/composables/useUserApi.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/sprinkle-admin/app/assets/composables/useUserApi.ts b/packages/sprinkle-admin/app/assets/composables/useUserApi.ts index 55f4258cb..223911a41 100644 --- a/packages/sprinkle-admin/app/assets/composables/useUserApi.ts +++ b/packages/sprinkle-admin/app/assets/composables/useUserApi.ts @@ -4,7 +4,19 @@ import { type AlertInterface, Severity } from '@userfrosting/sprinkle-core/inter import type { UserApi } from '../interfaces' /** - * + * API used to fetch data about a specific user. + * + * This interface is tied to the `UserApi` API, accessed at the GET + * `/api/users/u/{user_name}` endpoint and the `UserApi` Typescript interface. + * + * This composable accept a {user_name} to select the user. Any changes to the + * {user_name} is watched and will trigger an update. + * + * Available ref: + * - user: UserApi + * - error: AlertInterface | null + * - loading: boolean + * - fetchUser(): void - Trigger a refresh of the user data */ export function useUserApi(user_name: any) { const loading = ref(false)