mirror of
https://github.com/jambonz/jambonz-webapp.git
synced 2026-10-29 14:54:36 +00:00
Redirect away from forms when dependencies not met
This commit is contained in:
1 parent
7ab0aa7c2a
commit
838611607a
2 files changed
+34
No files matched your search
@@ -115,6 +115,16 @@ const ApplicationForm = props => {
|
||||
setAccounts(accounts);
|
||||
setApplications(applications);
|
||||
|
||||
if (accounts.length === 0) {
|
||||
history.push('/internal/accounts');
|
||||
dispatch({
|
||||
type: 'ADD',
|
||||
level: 'error',
|
||||
message: 'You must create an account before you can create an application.',
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
(props.type === 'setup' && accounts.length > 1) ||
|
||||
(props.type === 'setup' && applications.length > 1)
|
||||
|
||||
Reference in new issue
Block a user