Files
bigcapital/packages/webapp/src/hooks/query/workspaces.tsx
Ahmed Bouhuolia 6e04440fbd wip
2026-04-03 11:51:34 +02:00

23 lines
449 B
TypeScript

// @ts-nocheck
import { useRequestQuery } from '../useQueryRequest';
/**
* Retrieve workspaces of the authenticated user.
*/
export function useWorkspaces(props) {
return useRequestQuery(
['workspaces'],
{ method: 'get', url: 'workspaces' },
{
select: (res) => res.data.workspaces,
initialDataUpdatedAt: 0,
initialData: {
data: {
workspaces: [],
},
},
...props,
},
);
}