This commit is contained in:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user