mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
BC-5 fix: general tab of preferences form submitting.
This commit is contained in:
@@ -27,3 +27,4 @@ export * from './landedCost';
|
||||
export * from './UniversalSearch/UniversalSearch';
|
||||
export * from './GenericResource';
|
||||
export * from './jobs';
|
||||
export * from './misc';
|
||||
|
||||
16
client/src/hooks/query/misc.js
Normal file
16
client/src/hooks/query/misc.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { useRequestQuery } from '../useQueryRequest';
|
||||
|
||||
/**
|
||||
* Retrieve the job metadata.
|
||||
*/
|
||||
export function useDateFormats(props = {}) {
|
||||
return useRequestQuery(
|
||||
['DATE_FORMATS'],
|
||||
{ method: 'get', url: `/date_formats` },
|
||||
{
|
||||
select: (res) => res.data.data,
|
||||
defaultData: [],
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -72,3 +72,22 @@ export function useOrganizationSetup() {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the settings.
|
||||
*/
|
||||
export function useUpdateOrganization(props) {
|
||||
const queryClient = useQueryClient();
|
||||
const apiRequest = useApiRequest();
|
||||
|
||||
return useMutation(
|
||||
(information) => apiRequest.put('organization', information),
|
||||
{
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries(t.ORGANIZATION_CURRENT);
|
||||
queryClient.invalidateQueries(t.ORGANIZATIONS);
|
||||
},
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user