@@ -80,7 +80,7 @@ async function getForms (questionaryId) {
8080async function getFormHistorical ( questionaryId , formKey ) {
8181 const form = dataDefs . v2questionnaires [ questionaryId ] . forms [ formKey ] ;
8282 const formFields = form . itemKeys . map ( ( itemKey ) => {
83- const itemDef = ( hdsModel ( ) . itemDefForKey ( itemKey ) ) ;
83+ const itemDef = ( hdsModel ( ) . itemsDefs . forKey ( itemKey ) ) ;
8484
8585 return {
8686 id : itemDef . key ,
@@ -102,7 +102,7 @@ async function getFormHistorical (questionaryId, formKey) {
102102async function getFormPermanentContent ( questionaryId , formKey ) {
103103 const form = dataDefs . v2questionnaires [ questionaryId ] . forms [ formKey ] ;
104104 // get formItems
105- const formItemDefs = form . itemKeys . map ( ( itemKey ) => ( hdsModel ( ) . itemDefForKey ( itemKey ) ) ) ;
105+ const formItemDefs = form . itemKeys . map ( ( itemKey ) => ( hdsModel ( ) . itemsDefs . forKey ( itemKey ) ) ) ;
106106 // get the values from the API
107107 const apiCalls = formItemDefs . map ( itemDef => ( {
108108 method : 'events.get' ,
@@ -143,7 +143,7 @@ async function getFormPermanentContent (questionaryId, formKey) {
143143
144144async function getHistoricalContent ( questionaryId , formKey ) {
145145 const form = dataDefs . v2questionnaires [ questionaryId ] . forms [ formKey ] ;
146- const itemDefs = form . itemKeys . map ( ( itemKey ) => ( hdsModel ( ) . itemDefForKey ( itemKey ) ) ) ;
146+ const itemDefs = form . itemKeys . map ( ( itemKey ) => ( hdsModel ( ) . itemsDefs . forKey ( itemKey ) ) ) ;
147147 const tableHeaders = itemDefs . map ( itemDef => ( {
148148 fieldId : itemDef . key ,
149149 label : itemDef . data . label . en ,
@@ -152,7 +152,7 @@ async function getHistoricalContent(questionaryId, formKey) {
152152
153153 const valuesByDateStr = { } ;
154154 function addEntry ( event ) {
155- const itemDef = hdsModel ( ) . itemDefForEvent ( event , false ) ;
155+ const itemDef = hdsModel ( ) . itemsDefs . forEvent ( event , false ) ;
156156 if ( itemDef == null ) {
157157 console . log ( 'Historical content -- unkown event' , event ) ;
158158 return ;
0 commit comments