Created
January 16, 2019 00:49
-
-
Save beauraines/d98d65357d421d79506431745244c62b to your computer and use it in GitHub Desktop.
Adding firm production plan in workflow fails on the last line TypeError: Cannot read property 'push' of undefined
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sendAddProductionPlan() { | |
// Set required arguments | |
scope.activatedProductionPlan.bomID = null; | |
scope.activatedProductionPlan.type = 'USER-CREATED'; | |
// remap values | |
scope.activatedProductionPlan.dueDate = scope.activatedProductionPlan.due_date; | |
if ( scope.firmPlanOnly) { | |
scope.activatedProductionPlan.firmFlag = 1; | |
} else { | |
if (scope.activatedProductionPlan.firm_flag) { | |
scope.activatedProductionPlan.firmFlag = scope.activatedProductionPlan.firm_flag; | |
} else { | |
scope.activatedProductionPlan.firmFlag = 0; | |
} | |
} | |
if (scope.addOrEdit === 'add') { | |
// TODO: flash not working here after addition made | |
dataFactory.addProductionPlan(scope.activatedProductionPlan) | |
.success(function(data, status) { | |
// Need to check for status 304 here because the controller always returns a 200 | |
if (data.status != 304 ) { | |
scope.planningData.push(data.object); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
scope.planningData
is undefined!! Why?