mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-06-02 07:59:01 +00:00
wip
This commit is contained in:
22
packages/webapp/src/hooks/query/workspaces.tsx
Normal file
22
packages/webapp/src/hooks/query/workspaces.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
// @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,
|
||||
},
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user