mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
change the custom value as initialValue
This commit is contained in:
parent
79000ad133
commit
c86c5a62bf
@ -294,17 +294,13 @@ const ApiTokenCreateView = () => {
|
||||
initialValues={{
|
||||
name: apiToken?.name || '',
|
||||
description: apiToken?.description || '',
|
||||
type: apiToken?.type,
|
||||
type: state.selectedActions.length > 0 && !apiToken?.type ? 'custom' : apiToken?.type,
|
||||
lifespan: apiToken?.lifespan,
|
||||
}}
|
||||
enableReinitialize
|
||||
onSubmit={(body, actions) => handleSubmit(body, actions)}
|
||||
>
|
||||
{({ errors, handleChange, isSubmitting, values }) => {
|
||||
if (state.selectedActions.length > 0 && !values?.type) {
|
||||
values.type = 'custom';
|
||||
}
|
||||
|
||||
return (
|
||||
<Form>
|
||||
<HeaderLayout
|
||||
|
Loading…
x
Reference in New Issue
Block a user