Skip to content

Commit

Permalink
Add an http check on form updates as they default to success when the…
Browse files Browse the repository at this point in the history
…re is an error, ie 403
  • Loading branch information
RealZimboGuy committed Mar 24, 2024
1 parent df23d8e commit 7d7f80c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ const UpdateWorkflowInstanceSignalForm = function (props: {
signal: values.signal,
reason: values.reason
}).then((reason: any) => {
if (reason.error) {
if (!reason.ok) {
setErrorMsg(`HTTP error! status: ${reason.status}`);
setConfirmationMsg('');
} else if (reason.error) {
setErrorMsg(reason.error);
setConfirmationMsg('');
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ const UpdateWorkflowInstanceStateForm = function (props: {
),
actionDescription: values.actionDescription
}).then((reason: any) => {
if (reason.error) {
if (!reason.ok) {
setErrorMsg(`HTTP error! status: ${reason.status}`);
setConfirmationMsg('');
} else if (reason.error) {
setErrorMsg(reason.error);
setConfirmationMsg('');
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ const UpdateWorkflowInstanceStateVariableForm = function (props: {
},
actionDescription: values.actionDescription
}).then((reason: any) => {
if (reason.error) {
if (!reason.ok) {
setErrorMsg(`HTTP error! status: ${reason.status}`);
setConfirmationMsg('');
} else if (reason.error) {
setErrorMsg(reason.error);
setConfirmationMsg('');
} else {
Expand Down

0 comments on commit 7d7f80c

Please sign in to comment.