fix: organization lock base currency field.

This commit is contained in:
a.bouhuolia
2021-09-09 21:05:18 +02:00
parent 4b5aa3d898
commit 772c24e3ef
3 changed files with 22 additions and 1 deletions

View File

@@ -0,0 +1,8 @@
import { defaultFastFieldShouldUpdate } from 'utils';
export const shouldBaseCurrencyUpdate = (newProps, oldProps) => {
return (
newProps.baseCurrencyDisabled !== oldProps.baseCurrencyDisabled ||
defaultFastFieldShouldUpdate(newProps, oldProps)
);
};

View File

@@ -91,3 +91,15 @@ export function useUpdateOrganization(props) {
},
);
}
export function useOrgBaseCurrencyMutateAbilities(props) {
return useRequestQuery(
[t.ORGANIZATION_MUTATE_BASE_CURRENCY_ABILITIES],
{ method: 'get', url: `organization/base_currency_mutate` },
{
select: (res) => res.data.abilities,
defaultData: [],
...props,
},
);
}

View File

@@ -2,5 +2,6 @@
export default {
ORGANIZATION_SET: 'ORGANIZATION_SET',
ORGANIZATIONS_LIST_SET: 'ORGANIZATIONS_LIST_SET',
SET_ORGANIZATION_CONGRATS: 'SET_ORGANIZATION_CONGRATS'
SET_ORGANIZATION_CONGRATS: 'SET_ORGANIZATION_CONGRATS',
ORGANIZATION_MUTATE_BASE_CURRENCY_ABILITIES: 'ORGANIZATION_MUTATE_BASE_CURRENCY_ABILITIES'
};