pass the the correct model to id on create

This commit is contained in:
jasquat 2022-11-19 17:18:46 -05:00
parent d51db5cf99
commit 2bacbd3cbe
1 changed files with 2 additions and 3 deletions

View File

@ -24,7 +24,6 @@ export default function ProcessModelForm({
useState<boolean>(false); useState<boolean>(false);
const [displayNameInvalid, setDisplayNameInvalid] = useState<boolean>(false); const [displayNameInvalid, setDisplayNameInvalid] = useState<boolean>(false);
const navigate = useNavigate(); const navigate = useNavigate();
const modifiedProcessModelPath = modifyProcessModelPath(processModel.id);
const navigateToProcessModel = (result: ProcessModel) => { const navigateToProcessModel = (result: ProcessModel) => {
if ('id' in result) { if ('id' in result) {
@ -53,7 +52,7 @@ export default function ProcessModelForm({
if (hasErrors) { if (hasErrors) {
return; return;
} }
const path = `/process-models/${modifiedProcessModelPath}`; const path = `/process-models/${processGroupId}`;
let httpMethod = 'POST'; let httpMethod = 'POST';
if (mode === 'edit') { if (mode === 'edit') {
httpMethod = 'PUT'; httpMethod = 'PUT';
@ -64,7 +63,7 @@ export default function ProcessModelForm({
}; };
if (mode === 'new') { if (mode === 'new') {
Object.assign(postBody, { Object.assign(postBody, {
id: `${processGroupId}:${processModel.id}`, id: `${processGroupId}/${processModel.id}`,
}); });
} }