Adds loop to importTemplate function so that the whole file will import
Signed-off-by: Adam Woolford <adam.woolford@hotmail.com>
Signed-off-by: Jessica Woolford <jwoolford@biblio.org>
Signed-off-by: Beth Willis <willis@noblenet.org>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
try {
const template = JSON.parse(reader.result as string);
- const name = Object.keys(template)[0];
- this.volcopy.templates[name] = template[name];
- } catch (E) {
+ var theKeys = Object.keys(template);
+ for(let i = 0; i < theKeys.length; i++){
+ var name = theKeys[i];
+ this.volcopy.templates[name]=template[name];
+ };
+ } catch (E) {
console.error('Invalid Item Attribute template', E);
return;
}