From 75ff676fb0bd9c6e6b62e17dd76a47228a9b3a80 Mon Sep 17 00:00:00 2001 From: Matthew Warman Date: Tue, 2 Jul 2024 07:57:02 -0400 Subject: [PATCH] jsdoc --- src/pages/Users/api/useGetUser.ts | 9 +++++++++ src/pages/Users/api/useGetUsers.ts | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/pages/Users/api/useGetUser.ts b/src/pages/Users/api/useGetUser.ts index c499890..07c4c38 100644 --- a/src/pages/Users/api/useGetUser.ts +++ b/src/pages/Users/api/useGetUser.ts @@ -5,10 +5,19 @@ import { useConfig } from 'common/hooks/useConfig'; import { User } from 'common/models/user'; import { QueryKey } from 'common/utils/constants'; +/** + * Properties for the `useGetUser` API hook. + * @param {string} userId - A `User` identifier. + */ interface UseGetUserProps { userId: string; } +/** + * An API hook which fetches a single `User` object. + * @param {UseGetUserProps} props - Hook properties. + * @returns Returns a `UseQueryResult` with `User` data. + */ export const useGetUser = ({ userId }: UseGetUserProps) => { const config = useConfig(); diff --git a/src/pages/Users/api/useGetUsers.ts b/src/pages/Users/api/useGetUsers.ts index d0c327e..8248cdc 100644 --- a/src/pages/Users/api/useGetUsers.ts +++ b/src/pages/Users/api/useGetUsers.ts @@ -5,6 +5,10 @@ import { useConfig } from 'common/hooks/useConfig'; import { User } from 'common/models/user'; import { QueryKey } from 'common/utils/constants'; +/** + * An API hook which fetches a collection of `User` objects. + * @returns Returns a `UseQueryResult` with `User` collection data. + */ export const useGetUsers = () => { const config = useConfig();