Updating changePropertiesOrder method
This commit is contained in:
@@ -112,13 +112,19 @@ function resolveReference(rawSchemas: RJSFSchema, resource: any, prop_reference:
|
|||||||
|
|
||||||
function changePropertiesOrder(resource: any) {
|
function changePropertiesOrder(resource: any) {
|
||||||
let created_at;
|
let created_at;
|
||||||
|
let created_by;
|
||||||
let updated_at;
|
let updated_at;
|
||||||
|
let updated_by;
|
||||||
let new_properties: any = {};
|
let new_properties: any = {};
|
||||||
for (let prop_name in resource.properties) {
|
for (let prop_name in resource.properties) {
|
||||||
if (prop_name == 'created_at') {
|
if (prop_name == 'created_at') {
|
||||||
created_at = resource.properties[prop_name];
|
created_at = resource.properties[prop_name];
|
||||||
|
} else if (prop_name == 'created_by') {
|
||||||
|
created_by = resource.properties[prop_name];
|
||||||
} else if (prop_name == 'updated_at') {
|
} else if (prop_name == 'updated_at') {
|
||||||
updated_at = resource.properties[prop_name];
|
updated_at = resource.properties[prop_name];
|
||||||
|
} else if (prop_name == 'updated_by') {
|
||||||
|
updated_by = resource.properties[prop_name];
|
||||||
}else {
|
}else {
|
||||||
new_properties[prop_name] = resource.properties[prop_name];
|
new_properties[prop_name] = resource.properties[prop_name];
|
||||||
}
|
}
|
||||||
@@ -126,9 +132,15 @@ function changePropertiesOrder(resource: any) {
|
|||||||
if (created_at) {
|
if (created_at) {
|
||||||
new_properties['created_at'] = created_at;
|
new_properties['created_at'] = created_at;
|
||||||
}
|
}
|
||||||
|
if (created_by) {
|
||||||
|
new_properties['created_by'] = created_by;
|
||||||
|
}
|
||||||
if (updated_at) {
|
if (updated_at) {
|
||||||
new_properties['updated_at'] = updated_at;
|
new_properties['updated_at'] = updated_at;
|
||||||
}
|
}
|
||||||
|
if (updated_by) {
|
||||||
|
new_properties['updated_by'] = updated_by;
|
||||||
|
}
|
||||||
resource.properties = new_properties
|
resource.properties = new_properties
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user