@kravc/dos 1.11.8 → 1.11.9
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 +9 -4
package/package.json
CHANGED
package/src/Document.js
CHANGED
|
@@ -207,11 +207,13 @@ class Document extends Component {
|
|
|
207
207
|
|
|
208
208
|
/* NOTE: ensure that document to be updated exists and save it in the
|
|
209
209
|
context so can be referenced in the after action helper */
|
|
210
|
-
if (
|
|
210
|
+
if (originalDocument) {
|
|
211
|
+
this._extendWithPartition(context, query)
|
|
212
|
+
|
|
213
|
+
} else {
|
|
211
214
|
originalDocument = await this.read(context, query)
|
|
212
|
-
}
|
|
213
215
|
|
|
214
|
-
|
|
216
|
+
}
|
|
215
217
|
|
|
216
218
|
const updatedItem = await this._update(query, mutation)
|
|
217
219
|
|
|
@@ -247,8 +249,11 @@ class Document extends Component {
|
|
|
247
249
|
/* NOTE: ensure that document to be removed exists and save it in the
|
|
248
250
|
context so can be referenced in the after action helper */
|
|
249
251
|
const originalDocument = await this.read(context, query)
|
|
252
|
+
const hasQueryPartition = !!query.partition
|
|
250
253
|
|
|
251
|
-
|
|
254
|
+
if (!hasQueryPartition) {
|
|
255
|
+
this._extendWithPartition(context, query)
|
|
256
|
+
}
|
|
252
257
|
|
|
253
258
|
await this._delete(query, context)
|
|
254
259
|
|