Skip to content

Commit

Permalink
Allow plan status change to staff draft ignoring the errors on the fo…
Browse files Browse the repository at this point in the history
…rm - #1165
  • Loading branch information
Brijesh committed Sep 24, 2024
1 parent 40c62df commit 97e5190
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/rangeUsePlanPage/pageForStaff/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,21 +166,21 @@ class PageForStaff extends Component {
user={this.props.user}
plan={this.props.plan}
fetchPlan={this.props.fetchPlan}
beforeUpdateStatus={async () => {
beforeUpdateStatus={async (statusCode) => {
const { formik } = this.props;
await formik.submitForm();
const errors = await formik.validateForm();
const error = this.validateRup(this.props.plan);

console.log(error);
if (Object.keys(errors).length === 0 && !error) {
return true;
}

if (error) {
if (error && !(error.elementId === 'grazing_schedule' && statusCode === PLAN_STATUS.STAFF_DRAFT)) {
this.props.toastErrorMessage(error);
return false;
}

return false;
return true;
}}
/>
);
Expand Down

0 comments on commit 97e5190

Please sign in to comment.