Skip to content

Commit

Permalink
fix(ui): Cannot add an app that has both name and server destination (#…
Browse files Browse the repository at this point in the history
…21440)

Signed-off-by: Rafal Pelczar <[email protected]>
  • Loading branch information
rpelczar authored Jan 24, 2025
1 parent 75def4f commit 544aea1
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,16 @@ export const ApplicationCreatePanel = (props: {
}
}

const onCreateApp = (data: models.Application) => {
if (destinationComboValue === 'URL') {
delete data.spec.destination.name;
} else {
delete data.spec.destination.server;
}

props.createApp(data);
};

return (
<React.Fragment>
<DataLoader
Expand Down Expand Up @@ -223,7 +233,7 @@ export const ApplicationCreatePanel = (props: {
})}
defaultValues={app}
formDidUpdate={state => debouncedOnAppChanged(state.values as any)}
onSubmit={props.createApp}
onSubmit={onCreateApp}
getApi={props.getFormApi}>
{api => {
const generalPanel = () => (
Expand Down

0 comments on commit 544aea1

Please sign in to comment.