feat: refresh when role resource record exists

This commit is contained in:
chenos 2022-04-09 15:32:30 +08:00
parent c6f1454ae8
commit a4e943ace7

View File

@ -17,7 +17,7 @@ export const useRoleResourceValues = (options) => {
{ ...options, manual: true }, { ...options, manual: true },
); );
useEffect(() => { useEffect(() => {
if (record.usingConfig === 'strategy') { if (!record.exists) {
options.onSuccess({ options.onSuccess({
data: {}, data: {},
}); });
@ -26,6 +26,6 @@ export const useRoleResourceValues = (options) => {
if (visible) { if (visible) {
result.run(); result.run();
} }
}, [visible, record.usingConfig]); }, [visible, record.exists]);
return result; return result;
}; };