@kravc/dos 1.11.21 → 1.11.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/Document.js +4 -4
package/package.json
CHANGED
package/src/Document.js
CHANGED
|
@@ -74,7 +74,7 @@ class Document extends Component {
|
|
|
74
74
|
parameters.partition = this.getPartition(context, parameters)
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
static _extendWithCreateStamps(mutation) {
|
|
77
|
+
static _extendWithCreateStamps(context, mutation) {
|
|
78
78
|
const timestamp = new Date().toJSON()
|
|
79
79
|
mutation.createdAt = timestamp
|
|
80
80
|
mutation.updatedAt = timestamp
|
|
@@ -101,7 +101,7 @@ class Document extends Component {
|
|
|
101
101
|
const { validator } = context
|
|
102
102
|
mutation = validator.normalize(mutation, this.id)
|
|
103
103
|
|
|
104
|
-
this._extendWithCreateStamps(mutation)
|
|
104
|
+
this._extendWithCreateStamps(context, mutation)
|
|
105
105
|
|
|
106
106
|
if (this.beforeCreate) {
|
|
107
107
|
await this.beforeCreate(context, query, mutation)
|
|
@@ -193,7 +193,7 @@ class Document extends Component {
|
|
|
193
193
|
return this._index(query)
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
static _extendWithUpdateStamps(mutation) {
|
|
196
|
+
static _extendWithUpdateStamps(context, mutation) {
|
|
197
197
|
const timestamp = new Date().toJSON()
|
|
198
198
|
mutation.updatedAt = timestamp
|
|
199
199
|
mutation.updatedBy = get(context, IDENTITY_SUBJECT_PATH, SYSTEM)
|
|
@@ -202,7 +202,7 @@ class Document extends Component {
|
|
|
202
202
|
static async update(context, query, mutation, originalDocument = null) {
|
|
203
203
|
mutation = omit(mutation, [ this.idKey, 'createdAt', 'createdBy' ])
|
|
204
204
|
|
|
205
|
-
this._extendWithUpdateStamps(mutation)
|
|
205
|
+
this._extendWithUpdateStamps(context, mutation)
|
|
206
206
|
|
|
207
207
|
if (this.beforeUpdate) {
|
|
208
208
|
await this.beforeUpdate(context, query, mutation)
|