This commit is contained in:
2020-10-07 17:33:37 +00:00
parent 0185b6941c
commit 2a2bcc5f7f
7 changed files with 80 additions and 39 deletions

View File

@@ -18,7 +18,9 @@ function addDataKeyNames(obj) {
export default {
// cache the form customization data if it's not already present
async get(formKey) {
if (!window.$gz._.has(window.$gz.store.state.formCustomTemplate, formKey)) {
if (
!window.$gz.util.has(window.$gz.store.state.formCustomTemplate, formKey)
) {
//fetch and populate the store
let res = await window.$gz.api.get("form-custom/" + formKey);
if (res.error) {
@@ -56,11 +58,11 @@ export default {
);
}
//_https://lodash.com/docs#find
//Note that not every field being requested will exist so it's valid to return undefined
let templateItem = window.$gz._.find(template, ["fld", fieldKey]);
return templateItem;
//template is an array of objects that contain a key called "fld"
//de-lodash
//let templateItem = window.$gz. _.find(template, ["fld", fieldKey]);
return template.find(z => z.fld == fieldKey);
},
getTemplateConcurrencyToken(formKey) {
let tok =