CyCraft / CyCraft/blitzar

Cancel Original Data State (oldData) Update From Built-In Save Action

Open
#125 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vue
Stars
126
Forks
22
PR merge metrics
No merged PRs in 30d

Description

Hi Luca & team,

Nice work on all of this!

I'm wondering if there is a way to stop the automatic updating of the oldData to the formData from the built-in 'Save' action. As an example, I'm passing in a form-level validation function along with the schema, and I execute this additional function before saving to the back-end. If that validation fails I'll exit the function (defined on the Save button) without saving, the idea being that they need to continue to edit the form.

While I can force the form back into edit mode, at that point it has already made the 'oldData' equal to the 'formData', so if you click 'Cancel' after that it doesn't change it back to the original.

Is there any way to cancel the default behavior and keep them in edit without having the oldData get updated?

Thanks!
Tim

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.