cosey 0.6.0 → 0.6.1
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/hooks/useUpsert.d.ts +1 -1
- package/hooks/useUpsert.js +3 -3
- package/package.json +1 -1
package/hooks/useUpsert.d.ts
CHANGED
|
@@ -57,4 +57,4 @@ export interface UseExternalUpsertReturn<Row extends Record<string, any>, Data>
|
|
|
57
57
|
expose: Readonly<ShallowRef<UseUpsertExpose<Row, Data> | null>>;
|
|
58
58
|
ref: (_expose: any) => void;
|
|
59
59
|
}
|
|
60
|
-
export declare function useOuterUpsert<Row extends Record<string, any>, Data>(options
|
|
60
|
+
export declare function useOuterUpsert<Row extends Record<string, any>, Data>(options?: UseExternalUpsertOptions): UseExternalUpsertReturn<Row, Data>;
|
package/hooks/useUpsert.js
CHANGED
|
@@ -87,8 +87,8 @@ function useUpsert(options) {
|
|
|
87
87
|
if (unref(detailsFetch)) {
|
|
88
88
|
filledRow = await unref(detailsFetch)(row.value);
|
|
89
89
|
}
|
|
90
|
-
filledRow =
|
|
91
|
-
filledRow = unref(beforeFill)?.(filledRow) || filledRow;
|
|
90
|
+
filledRow = cloneDeep(filledRow);
|
|
91
|
+
filledRow = await unref(beforeFill)?.(filledRow) || filledRow;
|
|
92
92
|
Object.assign(unref(model), pick(filledRow, modelKeys));
|
|
93
93
|
},
|
|
94
94
|
add: (...args) => {
|
|
@@ -126,7 +126,7 @@ function useUpsert(options) {
|
|
|
126
126
|
};
|
|
127
127
|
return result;
|
|
128
128
|
}
|
|
129
|
-
function useOuterUpsert(options) {
|
|
129
|
+
function useOuterUpsert(options = {}) {
|
|
130
130
|
const expose = ref(null);
|
|
131
131
|
const vnodeRef = (_expose) => {
|
|
132
132
|
expose.value = _expose;
|