Skip to content

Reset flags on a single model instance when persisting #4

Description

@johnrix

I want to reset both flags on a single model instance when persisting it to a back-end database. (Presently, I'm using the Vuex ORM GraphQL plugin for the latter purpose, but that is somewhat orthogonal.)

I've tried the following (I haven't tried working with updates to $isNew yet):

        myModelInstance.$update({ '$isDirty': false, preventDirtyFlag: true }).then(result => {
            console.log('update result: ', result)
            myModelInstance.$push()
        })

However, the output from the log statement indicates my update had no effect. What am I doing wrong here?

It seems to me there should be a more explicit means of resetting flags for just a single instance, rather than just for all instances as is presently the case.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions