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