Created
December 7, 2018 13:29
-
-
Save diogobaltazar/cd3120f6f0abf1365d83b8cf0ac089bc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
form_data = {} | |
// evaluating the args out of the if-then clause enables them to be available | |
// inside the if-then body. They are intended to be evaluated on whether they're | |
// empty or not, but evaluating them on the if-then condition would not let all | |
// args be evaluated if at least one but the last was not empty. | |
lastEvolutionsEdit = {{admin_edit_evolution_txt.text}} | |
lastRoleEdit = {{admin_edit_role_txt.text}} | |
lastTrainEdit = {{admin_edit_training_txt.text}} | |
if (lastEvolutionsEdit || lastRoleEdit || lastTrainEdit ) { | |
lastID = {{COUNT__REP_DS_TRANSF__PHONO}}.result[0].totalHits | |
lastReport = {{getCurrentChosenProfessionReport}}[0] | |
form_data = { // exclude primary key | |
"PROFESSION": "" | |
, "ROLE": lastRoleEdit ? lastRoleEdit : lastReport.ROLE | |
, "ROLE_DATE": lastRoleEdit ? new Date(Date.now()) : lastReport.ROLE_DATE | |
, "EVOLUTIONS": lastEvolutionsEdit ? lastEvolutionsEdit : lastReport.EVOLUTIONS | |
, "EVOL_DATE": lastEvolutionsEdit ? new Date(Date.now()) : lastReport.EVOL_DATE | |
, "TRAIN_REC": lastTrainEdit ? lastTrainEdit : lastReport.TRAIN_REC | |
, "TRAIN_DATE": lastTrainEdit ? new Date(Date.now()) : lastReport.TRAIN_DATE | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment