fix: use key instead of id in appConfig

This commit is contained in:
Jakub P.
2024-10-24 19:42:54 +02:00
parent b47e859225
commit 0e4fc7efbc
2 changed files with 4 additions and 5 deletions

View File

@@ -30,16 +30,15 @@ function AdminApplicationCreateAuthClient(props) {
} = useAdminCreateAppAuthClient(appKey); } = useAdminCreateAppAuthClient(appKey);
const submitHandler = async (values) => { const submitHandler = async (values) => {
let appConfigId = appConfig?.data?.id; let appConfigKey = appConfig?.data?.key;
if (!appConfigId) { if (!appConfigKey) {
const { data: appConfigData } = await createAppConfig({ const { data: appConfigData } = await createAppConfig({
customConnectionAllowed: true, customConnectionAllowed: true,
shared: false, shared: false,
disabled: false, disabled: false,
}); });
appConfigKey = appConfigData.key;
appConfigId = appConfigData.id;
} }
const { name, active, ...formattedAuthDefaults } = values; const { name, active, ...formattedAuthDefaults } = values;

View File

@@ -468,7 +468,7 @@ export const AppConfigPropType = PropTypes.shape({
export const AppAuthClientPropType = PropTypes.shape({ export const AppAuthClientPropType = PropTypes.shape({
id: PropTypes.string, id: PropTypes.string,
name: PropTypes.string, name: PropTypes.string,
appConfigId: PropTypes.string, appConfigKey: PropTypes.string,
authDefaults: PropTypes.string, authDefaults: PropTypes.string,
formattedAuthDefaults: PropTypes.object, formattedAuthDefaults: PropTypes.object,
active: PropTypes.bool, active: PropTypes.bool,