api modified
This commit is contained in:
parent
7683afab7a
commit
b263dc2d09
@ -92,7 +92,7 @@ export class HomePageDataService {
|
||||
p_region_cur: {
|
||||
type: oracledb.CURSOR,
|
||||
dir: oracledb.BIND_OUT
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
outFormat: oracledb.OUT_FORMAT_OBJECT
|
||||
@ -246,7 +246,7 @@ export class HomePageDataService {
|
||||
throw new Error('No cursor returned from the stored procedure');
|
||||
}
|
||||
|
||||
return {
|
||||
let tableData = {
|
||||
p_basic_details,
|
||||
p_contacts,
|
||||
p_sequence,
|
||||
@ -260,6 +260,28 @@ export class HomePageDataService {
|
||||
p_region,
|
||||
};
|
||||
|
||||
let output = {}
|
||||
|
||||
for (const key in tableData) {
|
||||
// console.log(key);
|
||||
|
||||
output[key] = tableData[key].map(obj => {
|
||||
const newObj = { ...obj };
|
||||
for (const innerKey in obj) {
|
||||
if (key === 'p_fees_comm') {
|
||||
if (innerKey.includes(' ')) { // Check if the key has a space
|
||||
const newKey = innerKey.replace(/ /g, '_').toUpperCase(); // Replace spaces and convert to uppercase
|
||||
newObj[newKey] = obj[innerKey]; // Add the new key
|
||||
delete newObj[innerKey]; // Remove the old key
|
||||
}
|
||||
}
|
||||
}
|
||||
return newObj;
|
||||
});
|
||||
}
|
||||
|
||||
return output;
|
||||
|
||||
} catch (err) {
|
||||
console.error('Error fetching users: ', err);
|
||||
throw new Error('Error fetching users');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user