Skip to content

For single instance cannot set isDirty: false using update (vuex-orm-core .36.3 and change-flags 1.2.3) #12

Closed
@vikaskedia

Description

@vikaskedia

The code I am running is:

  console.log("trying to set isdirty false")
  ormRem.update({
    data: { 
      uuid: item.uuid,
      '$isDirty': false, 
    },
    preventDirtyFlag: true
  }).then(result => {
    console.log('update result: ', result)
  })
})

The output I get is:

image

The definition of model is at:
https://github.com/savantcare/ptfile/blob/master/ptclient/components/rem/vuex-orm/model.js

import { Model } from '@vuex-orm/core'
const { v1: uuidv1 } = require('uuid')

export default class reminders extends Model {
  // This is the name used as module name of the Vuex Store.
  static entity = 'rem'

  static primaryKey = 'uuid' // Ref: https://vuex-orm.org/guide/model/defining-models.html#primary-key

  // List of all fields (schema) of the post model. `this.attr` is used
  // for the generic field type. The argument is the default value.
  static fields() {
    return {
      uuid: this.uid(() => uuidv1()),
      uuidOfRemMadeFor: this.attr(null),
      remDescription: this.attr(null),
      notes: this.attr(null),
      priority: this.number(0),
      isAutoRem: this.number(0),
      recordChangedByUUID: this.attr(null),
      recordChangedFromIPAddress: this.attr(null),
      recordChangedFromSection: this.attr(null),
      // Why store time as a number? Since vuex-orm does not understand dates.
      // The data types that vuex-orm understands are given at: https://vuex-orm.org/guide/model/defining-models.html#generic-type
      ROW_START: this.number(0),
      ROW_END: this.number(0),
    }
  }
}

Is this a bug?

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