Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed Jan 14, 2025
1 parent 57eb32d commit 91f0bd7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/sprinkle-admin/app/assets/composables/useUserApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 91f0bd7

Please sign in to comment.