mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
BIG-26: fix items preferences form.
This commit is contained in:
@@ -99,4 +99,16 @@ export function useSettingsManualJournals(props) {
|
||||
{ group: 'sale_receipts' },
|
||||
props,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve sale receipts settings.
|
||||
* @param {*} props
|
||||
*/
|
||||
export function useSettingsItems(props) {
|
||||
return useSettingsQuery(
|
||||
[t.SETTING, t.SETTING_ITEMS],
|
||||
{ group: 'items' },
|
||||
props,
|
||||
);
|
||||
}
|
||||
@@ -99,6 +99,7 @@ const SETTING = {
|
||||
SETTING_RECEIPTS: 'SETTING_RECEIPTS',
|
||||
SETTING_PAYMENT_RECEIVES: 'SETTING_PAYMENT_RECEIVES',
|
||||
SETTING_MANUAL_JOURNALS: 'SETTING_MANUAL_JOURNALS',
|
||||
SETTING_ITEMS: 'SETTING_ITEMS'
|
||||
};
|
||||
|
||||
const ORGANIZATIONS = {
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
import { useCallback } from "react";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { useCallback } from 'react';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import { setSettings } from 'store/settings/settings.actions';
|
||||
|
||||
|
||||
export const useSetSettings = () => {
|
||||
const dispatch = useDispatch();
|
||||
const dispatch = useDispatch();
|
||||
|
||||
return useCallback((settings) => {
|
||||
dispatch(setSettings(settings));
|
||||
}, [dispatch]);
|
||||
};
|
||||
return useCallback(
|
||||
(settings) => {
|
||||
dispatch(setSettings(settings));
|
||||
},
|
||||
[dispatch],
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve the authentication token.
|
||||
*/
|
||||
export const useSettingsSelector = () => {
|
||||
return useSelector((state) => state.settings.data);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user