ui-soxo-bootstrap-core 2.6.1-dev.5 → 2.6.1-dev.6
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/core/models/base/base.js
CHANGED
|
@@ -88,9 +88,13 @@ class BaseAPI {
|
|
|
88
88
|
* Get the data from the table
|
|
89
89
|
*/
|
|
90
90
|
get(config = {}) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
const { url, headers, ...rest } = config;
|
|
92
|
+
return ApiUtils.get({
|
|
93
|
+
url: url || this.endpoint,
|
|
94
|
+
headers,
|
|
95
|
+
config: rest,
|
|
96
|
+
...rest,
|
|
97
|
+
});
|
|
94
98
|
}
|
|
95
99
|
|
|
96
100
|
getRelations(id) {
|
|
@@ -177,16 +177,21 @@ class MenusAPI extends Base {
|
|
|
177
177
|
* @param {*} menu
|
|
178
178
|
* @returns
|
|
179
179
|
*/
|
|
180
|
-
getMenus = (config) => {
|
|
180
|
+
getMenus = (config, dbPtr = null) => {
|
|
181
181
|
// Use 'core-menus' endpoint if REACT_APP_USE_CORE_MENUS is true (used for Matria)
|
|
182
182
|
const url =
|
|
183
183
|
process.env.REACT_APP_USE_CORE_MENUS === 'true'
|
|
184
184
|
? 'core-menus/get-menus' // Matria
|
|
185
185
|
: 'menus/get-menus'; // NURA
|
|
186
186
|
|
|
187
|
+
if (!dbPtr) dbPtr = localStorage.db_ptr;
|
|
188
|
+
|
|
187
189
|
return this.get({
|
|
188
190
|
url,
|
|
189
191
|
config,
|
|
192
|
+
headers: {
|
|
193
|
+
db_ptr: dbPtr,
|
|
194
|
+
},
|
|
190
195
|
}).then((result) => result);
|
|
191
196
|
};
|
|
192
197
|
|
|
@@ -314,8 +314,12 @@ export default function ReportingDashboard({
|
|
|
314
314
|
|
|
315
315
|
// Fetch result
|
|
316
316
|
const result = await CoreScripts.getReportingLisitng(coreScriptId, formBody, dbPtr);
|
|
317
|
+
|
|
318
|
+
const apiData = Array.isArray(result) ? result : Array.isArray(result?.result) ? result.result : [];
|
|
319
|
+
|
|
317
320
|
// Handle both result formats
|
|
318
|
-
let resultDetails =
|
|
321
|
+
let resultDetails = apiData[0] || [];
|
|
322
|
+
|
|
319
323
|
if (result?.result && result?.result[0]) {
|
|
320
324
|
resultDetails = result.result[0];
|
|
321
325
|
}
|