@sanity/client 5.4.1-lazy-event-source.0 → 5.4.2
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/dist/index.browser.cjs +11 -2
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +11 -2
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +12 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/data/dataMethods.ts +9 -8
- package/src/types.ts +1 -0
- package/umd/sanityClient.js +11 -2
- package/umd/sanityClient.min.js +3 -3
package/dist/index.browser.cjs
CHANGED
|
@@ -730,9 +730,18 @@ function _delete(client, httpRequest, selection, options) {
|
|
|
730
730
|
}, options);
|
|
731
731
|
}
|
|
732
732
|
function _mutate(client, httpRequest, mutations, options) {
|
|
733
|
-
|
|
733
|
+
let mut;
|
|
734
|
+
if (mutations instanceof Patch || mutations instanceof ObservablePatch) {
|
|
735
|
+
mut = {
|
|
736
|
+
patch: mutations.serialize()
|
|
737
|
+
};
|
|
738
|
+
} else if (mutations instanceof Transaction || mutations instanceof ObservableTransaction) {
|
|
739
|
+
mut = mutations.serialize();
|
|
740
|
+
} else {
|
|
741
|
+
mut = mutations;
|
|
742
|
+
}
|
|
734
743
|
const muts = Array.isArray(mut) ? mut : [mut];
|
|
735
|
-
const transactionId = options && options.transactionId;
|
|
744
|
+
const transactionId = options && options.transactionId || void 0;
|
|
736
745
|
return _dataRequest(client, httpRequest, "mutate", {
|
|
737
746
|
mutations: muts,
|
|
738
747
|
transactionId
|