Ensuring id is sent for field updates
@@ -73,13 +73,15 @@ function controller($q, notification, serviceBroker) {
const specDefFieldPromise = serviceBroker
.loadViewData(
CORE_API.PhysicalSpecDefinitionFieldStore.findForSpecDefinitionId,
- [ vm.selectedSpecDefinition.def.id ])
+ [ vm.selectedSpecDefinition.def.id ],
+ { force })
.then(r => r.data);
const specDefSampleFilePromise = serviceBroker
.loadViewData(
CORE_API.PhysicalSpecDefinitionSampleFileStore.findForSpecDefinitionId,
- [vm.selectedSpecDefinition.def.id])
+ [vm.selectedSpecDefinition.def.id],
+ { force })
.then(r => r.data);
const selectionOptions = {
@@ -88,7 +90,10 @@ function controller($q, notification, serviceBroker) {
};
const logicalElementsPromise = serviceBroker
- .loadViewData(CORE_API.LogicalDataElementStore.findBySelector, [ selectionOptions ], { force })
+ .loadViewData(
+ CORE_API.LogicalDataElementStore.findBySelector,
+ [ selectionOptions ],
+ { force })
.then(r => r.data);
$q.all([specDefFieldPromise, specDefSampleFilePromise, logicalElementsPromise])
@@ -146,10 +151,10 @@ function controller($q, notification, serviceBroker) {
}
};
- vm.updateFieldDescription = (change, fieldId) => {
+ vm.updateFieldDescription = (change, field) => {
const cmd = { newDescription: change.newVal };
serviceBroker
- .execute(CORE_API.PhysicalSpecDefinitionFieldStore.updateDescription, [fieldId, cmd])
+ .execute(CORE_API.PhysicalSpecDefinitionFieldStore.updateDescription, [field.id, cmd])
.then(result => {
if (result) {
notification.success("Updated description for field");
@@ -161,10 +166,10 @@ function controller($q, notification, serviceBroker) {
};
- vm.updateLogicalDataElement = (change, fieldId) => {
+ vm.updateLogicalDataElement = (change, field) => {
const cmd = { newLogicalDataElement: change.newVal };
serviceBroker
- .execute(CORE_API.PhysicalSpecDefinitionFieldStore.updateLogicalElement, [fieldId, cmd])
+ .execute(CORE_API.PhysicalSpecDefinitionFieldStore.updateLogicalElement, [field.id, cmd])
.then(result => {
if (result) {
notification.success("Updated logical data element for field");
