commons-shared-web-ui 0.0.17 → 0.0.18
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.
|
@@ -6984,9 +6984,13 @@ class SmartTableComponent {
|
|
|
6984
6984
|
let request$; // Observable
|
|
6985
6985
|
if (totalCountConfig?.source === 'separate' && totalCountConfig.apiUrl) {
|
|
6986
6986
|
const headers = this.getHeaders();
|
|
6987
|
+
const method = this.config.apiMethod || 'GET';
|
|
6988
|
+
const body = this.config.apiPayload || {};
|
|
6989
|
+
const dataRequest$ = method === 'POST' ? this.http.post(this.config.apiUrl, body, { params, headers }) : this.http.get(this.config.apiUrl, { params, headers });
|
|
6990
|
+
const countRequest$ = method === 'POST' ? this.http.post(totalCountConfig.apiUrl, body, { params, headers }) : this.http.get(totalCountConfig.apiUrl, { params, headers });
|
|
6987
6991
|
request$ = forkJoin({
|
|
6988
|
-
data:
|
|
6989
|
-
count:
|
|
6992
|
+
data: dataRequest$,
|
|
6993
|
+
count: countRequest$
|
|
6990
6994
|
}).pipe(map(({ data, count }) => {
|
|
6991
6995
|
const dataPath = this.config.dataResponsePath !== undefined ? this.config.dataResponsePath : '';
|
|
6992
6996
|
return {
|
|
@@ -6997,7 +7001,10 @@ class SmartTableComponent {
|
|
|
6997
7001
|
}
|
|
6998
7002
|
else {
|
|
6999
7003
|
const headers = this.getHeaders();
|
|
7000
|
-
|
|
7004
|
+
const method = this.config.apiMethod || 'GET';
|
|
7005
|
+
const body = this.config.apiPayload || {};
|
|
7006
|
+
const baseRequest$ = method === 'POST' ? this.http.post(this.config.apiUrl, body, { params, headers }) : this.http.get(this.config.apiUrl, { params, headers });
|
|
7007
|
+
request$ = baseRequest$.pipe(map(response => {
|
|
7001
7008
|
const dataPath = this.config.dataResponsePath !== undefined ? this.config.dataResponsePath : '';
|
|
7002
7009
|
const totalPath = totalCountConfig?.responsePath || '';
|
|
7003
7010
|
return {
|
|
@@ -7241,7 +7248,12 @@ class SmartTableComponent {
|
|
|
7241
7248
|
params = params.set(paramName, baseValue);
|
|
7242
7249
|
}
|
|
7243
7250
|
}
|
|
7244
|
-
|
|
7251
|
+
const method = filter.apiMethod || 'GET';
|
|
7252
|
+
const body = filter.apiPayload || {};
|
|
7253
|
+
const request$ = method === 'POST'
|
|
7254
|
+
? this.http.post(filter.apiUrl, body, { headers, params })
|
|
7255
|
+
: this.http.get(filter.apiUrl, { headers, params });
|
|
7256
|
+
request$.subscribe({
|
|
7245
7257
|
next: (response) => {
|
|
7246
7258
|
const data = filter.dataPath ? this.getValueByPath(response, filter.dataPath) : response;
|
|
7247
7259
|
if (!Array.isArray(data)) {
|