fix: dashboard sidebar expanding.

This commit is contained in:
a.bouhuolia
2021-04-19 18:34:02 +02:00
parent c6aca4ecfa
commit f29c1b6cec
27 changed files with 178 additions and 230 deletions

View File

@@ -7,8 +7,29 @@ import { useQueryTenant } from '../useQueryRequest';
export function useContact(id, props) {
const apiRequest = useApiRequest();
return useQueryTenant(['CONTACT', id], () => apiRequest.get(`contacts/${id}`), {
select: (res) => res.data.customer,
...props,
});
return useQueryTenant(
['CONTACT', id],
() => apiRequest.get(`contacts/${id}`),
{
select: (res) => res.data.customer,
...props,
},
);
}
/**
* Retrieve the auto-complete contacts.
*/
export function useAutoCompleteContacts(props) {
const apiRequest = useApiRequest();
return useQueryTenant(
['CONTACTS', 'AUTO-COMPLETE'],
() => apiRequest.get('contacts/auto-complete'),
{
select: (res) => res.data.contacts,
defaultData: [],
...props,
},
);
}

View File

@@ -96,8 +96,17 @@ const ORGANIZATIONS = {
const SUBSCRIPTIONS = {
SUBSCRIPTIONS: 'SUBSCRIPTIONS',
}
};
const EXPENSES = {
EXPENSES: 'EXPENSES',
EXPENSE: 'EXPENSE',
};
const MANUAL_JOURNALS = {
MANUAL_JOURNALS: 'MANUAL_JOURNALS',
MANUAL_JOURNAL: 'MANUAL_JOURNAL',
};
export default {
...ACCOUNTS,
...BILLS,
@@ -115,5 +124,7 @@ export default {
...USERS,
...SETTING,
...ORGANIZATIONS,
...SUBSCRIPTIONS
...SUBSCRIPTIONS,
...EXPENSES,
...MANUAL_JOURNALS
};