@etsoo/appscript 1.4.65 → 1.4.67
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/lib/cjs/business/ShoppingCart.js +1 -0
- package/lib/cjs/erp/EntityApi.d.ts +10 -0
- package/lib/cjs/erp/EntityApi.js +12 -0
- package/lib/mjs/business/ShoppingCart.js +1 -0
- package/lib/mjs/erp/EntityApi.d.ts +10 -0
- package/lib/mjs/erp/EntityApi.js +12 -0
- package/package.json +1 -1
- package/src/business/ShoppingCart.ts +1 -0
- package/src/erp/EntityApi.ts +17 -0
|
@@ -85,6 +85,16 @@ export declare class EntityApi<T extends IApp = IApp> extends BaseApi<T> {
|
|
|
85
85
|
protected sortBase<RQ extends {
|
|
86
86
|
id: DataTypes.IdType;
|
|
87
87
|
}>(items: RQ[], payload?: IApiPayload<number>): Promise<number | undefined>;
|
|
88
|
+
/**
|
|
89
|
+
* Sort with category
|
|
90
|
+
* @param category Category for grouping
|
|
91
|
+
* @param items Items to sort
|
|
92
|
+
* @param payload Payload
|
|
93
|
+
* @returns Result
|
|
94
|
+
*/
|
|
95
|
+
protected sortWith<RQ extends {
|
|
96
|
+
id: DataTypes.IdType;
|
|
97
|
+
}>(category: number, items: RQ[], payload?: IApiPayload<number>): Promise<number | undefined>;
|
|
88
98
|
/**
|
|
89
99
|
* Update
|
|
90
100
|
* @param data Modal data
|
package/lib/cjs/erp/EntityApi.js
CHANGED
|
@@ -101,6 +101,18 @@ class EntityApi extends BaseApi_1.BaseApi {
|
|
|
101
101
|
items.forEach((item, index) => (rq[item.id] = index));
|
|
102
102
|
return this.api.put(`${this.flag}/Sort`, rq, payload);
|
|
103
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* Sort with category
|
|
106
|
+
* @param category Category for grouping
|
|
107
|
+
* @param items Items to sort
|
|
108
|
+
* @param payload Payload
|
|
109
|
+
* @returns Result
|
|
110
|
+
*/
|
|
111
|
+
sortWith(category, items, payload) {
|
|
112
|
+
const data = {};
|
|
113
|
+
items.forEach((item, index) => (data[item.id] = index));
|
|
114
|
+
return this.api.put(`${this.flag}/Sort`, { category, data }, payload);
|
|
115
|
+
}
|
|
104
116
|
/**
|
|
105
117
|
* Update
|
|
106
118
|
* @param data Modal data
|
|
@@ -85,6 +85,16 @@ export declare class EntityApi<T extends IApp = IApp> extends BaseApi<T> {
|
|
|
85
85
|
protected sortBase<RQ extends {
|
|
86
86
|
id: DataTypes.IdType;
|
|
87
87
|
}>(items: RQ[], payload?: IApiPayload<number>): Promise<number | undefined>;
|
|
88
|
+
/**
|
|
89
|
+
* Sort with category
|
|
90
|
+
* @param category Category for grouping
|
|
91
|
+
* @param items Items to sort
|
|
92
|
+
* @param payload Payload
|
|
93
|
+
* @returns Result
|
|
94
|
+
*/
|
|
95
|
+
protected sortWith<RQ extends {
|
|
96
|
+
id: DataTypes.IdType;
|
|
97
|
+
}>(category: number, items: RQ[], payload?: IApiPayload<number>): Promise<number | undefined>;
|
|
88
98
|
/**
|
|
89
99
|
* Update
|
|
90
100
|
* @param data Modal data
|
package/lib/mjs/erp/EntityApi.js
CHANGED
|
@@ -98,6 +98,18 @@ export class EntityApi extends BaseApi {
|
|
|
98
98
|
items.forEach((item, index) => (rq[item.id] = index));
|
|
99
99
|
return this.api.put(`${this.flag}/Sort`, rq, payload);
|
|
100
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Sort with category
|
|
103
|
+
* @param category Category for grouping
|
|
104
|
+
* @param items Items to sort
|
|
105
|
+
* @param payload Payload
|
|
106
|
+
* @returns Result
|
|
107
|
+
*/
|
|
108
|
+
sortWith(category, items, payload) {
|
|
109
|
+
const data = {};
|
|
110
|
+
items.forEach((item, index) => (data[item.id] = index));
|
|
111
|
+
return this.api.put(`${this.flag}/Sort`, { category, data }, payload);
|
|
112
|
+
}
|
|
101
113
|
/**
|
|
102
114
|
* Update
|
|
103
115
|
* @param data Modal data
|
package/package.json
CHANGED
package/src/erp/EntityApi.ts
CHANGED
|
@@ -160,6 +160,23 @@ export class EntityApi<T extends IApp = IApp> extends BaseApi<T> {
|
|
|
160
160
|
return this.api.put(`${this.flag}/Sort`, rq, payload);
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
+
/**
|
|
164
|
+
* Sort with category
|
|
165
|
+
* @param category Category for grouping
|
|
166
|
+
* @param items Items to sort
|
|
167
|
+
* @param payload Payload
|
|
168
|
+
* @returns Result
|
|
169
|
+
*/
|
|
170
|
+
protected sortWith<RQ extends { id: DataTypes.IdType }>(
|
|
171
|
+
category: number,
|
|
172
|
+
items: RQ[],
|
|
173
|
+
payload?: IApiPayload<number>
|
|
174
|
+
) {
|
|
175
|
+
const data: Record<DataTypes.IdType, number> = {};
|
|
176
|
+
items.forEach((item, index) => (data[item.id] = index));
|
|
177
|
+
return this.api.put(`${this.flag}/Sort`, { category, data }, payload);
|
|
178
|
+
}
|
|
179
|
+
|
|
163
180
|
/**
|
|
164
181
|
* Update
|
|
165
182
|
* @param data Modal data
|