bt-core-app 2.0.53 → 2.0.54
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/bt-core-app.js +2 -2
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/bt-core-app.js
CHANGED
|
@@ -9186,8 +9186,8 @@ function bh(e) {
|
|
|
9186
9186
|
})), k != null ? p.onSaveAsync ?? (p.onSaveAsync = async (S) => {
|
|
9187
9187
|
if (S == null)
|
|
9188
9188
|
return;
|
|
9189
|
-
|
|
9190
|
-
return p.data = S, C == "new" ? await k().post(p) : await k().patch(p);
|
|
9189
|
+
let C;
|
|
9190
|
+
return p.getMode != null && (typeof p.getMode == "string" ? C = p.getMode : C = p.getMode(S)), p.data = S, C == "new" || C == "post" ? await k().post(p) : await k().patch(p);
|
|
9191
9191
|
}) : p.onSaveAsync ?? (p.onSaveAsync = (S) => {
|
|
9192
9192
|
const C = b.findIndex((M) => M.id == S.id);
|
|
9193
9193
|
return C >= 0 ? b.splice(C, 1, S) : b.push(S), Promise.resolve(S);
|
package/dist/index.d.ts
CHANGED
|
@@ -1533,7 +1533,7 @@ export declare interface SaveItemOptions {
|
|
|
1533
1533
|
}
|
|
1534
1534
|
|
|
1535
1535
|
export declare interface SaveOptions<T, TSave, TReturn> extends StoreAction, StorePathOptions, DoActionOptions {
|
|
1536
|
-
getMode?: (item: any) => BladeMode;
|
|
1536
|
+
getMode?: 'post' | 'patch' | ((item: any) => BladeMode);
|
|
1537
1537
|
/**called to check whether to proceed with save */
|
|
1538
1538
|
onCanSaveAsync?: OnCanDoAsync<T | TSave>;
|
|
1539
1539
|
/**
|
package/package.json
CHANGED