fix delete all permissions on create

This commit is contained in:
Simone Taeggi 2022-09-08 15:21:06 +02:00
parent 3a81a1ddf3
commit eefc744724

View File

@ -57,7 +57,7 @@ const ApiTokenCreateView = () => {
);
const { trackUsage } = useTracking();
const trackUsageRef = useRef(trackUsage);
const typeApiToken = useRef('custom');
const typeApiToken = useRef(undefined);
const { setCurrentStep } = useGuidedTour();
const {
allowedActions: { canCreate, canUpdate },
@ -307,6 +307,8 @@ const ApiTokenCreateView = () => {
if (state.selectedActions.length > 0 && !values?.type) {
typeApiToken.current = typeApiToken.current ? typeApiToken.current : 'custom';
values.type = typeApiToken.current;
} else if (state.selectedActions.length === 0 && typeApiToken.current !== undefined) {
values.type = typeApiToken.current;
}
return (
@ -500,7 +502,6 @@ const ApiTokenCreateView = () => {
}
onChange={(value) => {
handleChangeSelectApiTokenType({ target: { value } });
console.log('value', value);
handleChange({ target: { name: 'type', value } });
}}
placeholder="Select"