@etsoo/appscript 1.4.67 → 1.4.69
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.
|
@@ -89,12 +89,13 @@ export declare class EntityApi<T extends IApp = IApp> extends BaseApi<T> {
|
|
|
89
89
|
* Sort with category
|
|
90
90
|
* @param category Category for grouping
|
|
91
91
|
* @param items Items to sort
|
|
92
|
+
* @param method Sort method
|
|
92
93
|
* @param payload Payload
|
|
93
94
|
* @returns Result
|
|
94
95
|
*/
|
|
95
96
|
protected sortWith<RQ extends {
|
|
96
97
|
id: DataTypes.IdType;
|
|
97
|
-
}>(category: number, items: RQ[], payload?: IApiPayload<number>): Promise<number | undefined>;
|
|
98
|
+
}>(category: number, items: RQ[], method?: string, payload?: IApiPayload<number>): Promise<number | undefined>;
|
|
98
99
|
/**
|
|
99
100
|
* Update
|
|
100
101
|
* @param data Modal data
|
package/lib/cjs/erp/EntityApi.js
CHANGED
|
@@ -105,13 +105,14 @@ class EntityApi extends BaseApi_1.BaseApi {
|
|
|
105
105
|
* Sort with category
|
|
106
106
|
* @param category Category for grouping
|
|
107
107
|
* @param items Items to sort
|
|
108
|
+
* @param method Sort method
|
|
108
109
|
* @param payload Payload
|
|
109
110
|
* @returns Result
|
|
110
111
|
*/
|
|
111
|
-
sortWith(category, items, payload) {
|
|
112
|
+
sortWith(category, items, method = 'Sort', payload) {
|
|
112
113
|
const data = {};
|
|
113
114
|
items.forEach((item, index) => (data[item.id] = index));
|
|
114
|
-
return this.api.put(`${this.flag}
|
|
115
|
+
return this.api.put(`${this.flag}/${method}`, { category, data }, payload);
|
|
115
116
|
}
|
|
116
117
|
/**
|
|
117
118
|
* Update
|
|
@@ -89,12 +89,13 @@ export declare class EntityApi<T extends IApp = IApp> extends BaseApi<T> {
|
|
|
89
89
|
* Sort with category
|
|
90
90
|
* @param category Category for grouping
|
|
91
91
|
* @param items Items to sort
|
|
92
|
+
* @param method Sort method
|
|
92
93
|
* @param payload Payload
|
|
93
94
|
* @returns Result
|
|
94
95
|
*/
|
|
95
96
|
protected sortWith<RQ extends {
|
|
96
97
|
id: DataTypes.IdType;
|
|
97
|
-
}>(category: number, items: RQ[], payload?: IApiPayload<number>): Promise<number | undefined>;
|
|
98
|
+
}>(category: number, items: RQ[], method?: string, payload?: IApiPayload<number>): Promise<number | undefined>;
|
|
98
99
|
/**
|
|
99
100
|
* Update
|
|
100
101
|
* @param data Modal data
|
package/lib/mjs/erp/EntityApi.js
CHANGED
|
@@ -102,13 +102,14 @@ export class EntityApi extends BaseApi {
|
|
|
102
102
|
* Sort with category
|
|
103
103
|
* @param category Category for grouping
|
|
104
104
|
* @param items Items to sort
|
|
105
|
+
* @param method Sort method
|
|
105
106
|
* @param payload Payload
|
|
106
107
|
* @returns Result
|
|
107
108
|
*/
|
|
108
|
-
sortWith(category, items, payload) {
|
|
109
|
+
sortWith(category, items, method = 'Sort', payload) {
|
|
109
110
|
const data = {};
|
|
110
111
|
items.forEach((item, index) => (data[item.id] = index));
|
|
111
|
-
return this.api.put(`${this.flag}
|
|
112
|
+
return this.api.put(`${this.flag}/${method}`, { category, data }, payload);
|
|
112
113
|
}
|
|
113
114
|
/**
|
|
114
115
|
* Update
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/appscript",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.69",
|
|
4
4
|
"description": "Applications shared TypeScript framework",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -54,17 +54,17 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@etsoo/notificationbase": "^1.1.30",
|
|
56
56
|
"@etsoo/restclient": "^1.0.93",
|
|
57
|
-
"@etsoo/shared": "^1.2.
|
|
57
|
+
"@etsoo/shared": "^1.2.19",
|
|
58
58
|
"crypto-js": "^4.2.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@babel/cli": "^7.23.0",
|
|
62
|
-
"@babel/core": "^7.23.
|
|
63
|
-
"@babel/plugin-transform-runtime": "^7.23.
|
|
64
|
-
"@babel/preset-env": "^7.23.
|
|
62
|
+
"@babel/core": "^7.23.3",
|
|
63
|
+
"@babel/plugin-transform-runtime": "^7.23.3",
|
|
64
|
+
"@babel/preset-env": "^7.23.3",
|
|
65
65
|
"@babel/runtime-corejs3": "^7.23.2",
|
|
66
|
-
"@types/crypto-js": "^4.1
|
|
67
|
-
"@types/jest": "^29.5.
|
|
66
|
+
"@types/crypto-js": "^4.2.1",
|
|
67
|
+
"@types/jest": "^29.5.8",
|
|
68
68
|
"jest": "^29.7.0",
|
|
69
69
|
"jest-environment-jsdom": "^29.7.0",
|
|
70
70
|
"ts-jest": "^29.1.1",
|
package/src/erp/EntityApi.ts
CHANGED
|
@@ -164,17 +164,23 @@ export class EntityApi<T extends IApp = IApp> extends BaseApi<T> {
|
|
|
164
164
|
* Sort with category
|
|
165
165
|
* @param category Category for grouping
|
|
166
166
|
* @param items Items to sort
|
|
167
|
+
* @param method Sort method
|
|
167
168
|
* @param payload Payload
|
|
168
169
|
* @returns Result
|
|
169
170
|
*/
|
|
170
171
|
protected sortWith<RQ extends { id: DataTypes.IdType }>(
|
|
171
172
|
category: number,
|
|
172
173
|
items: RQ[],
|
|
174
|
+
method: string = 'Sort',
|
|
173
175
|
payload?: IApiPayload<number>
|
|
174
176
|
) {
|
|
175
177
|
const data: Record<DataTypes.IdType, number> = {};
|
|
176
178
|
items.forEach((item, index) => (data[item.id] = index));
|
|
177
|
-
return this.api.put(
|
|
179
|
+
return this.api.put(
|
|
180
|
+
`${this.flag}/${method}`,
|
|
181
|
+
{ category, data },
|
|
182
|
+
payload
|
|
183
|
+
);
|
|
178
184
|
}
|
|
179
185
|
|
|
180
186
|
/**
|