mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-06-01 23:49:00 +00:00
23 lines
449 B
TypeScript
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,
|
|
},
|
|
);
|
|
}
|