After I use JSON.parse some field gets empty string value.
I get the data using localStorage.getItem("letter_" + i);
Then we have:
{"id":2,"body":"heyyy","attachfilephoto":"","private_attachfilephoto":"de0371e568a0449f29d5d4e644ff20e7|98472274636224c27e2033fdd6c4d790|3adb5e0829e56d8dc1a47134885eaf3a|","short_video_attachfilephoto":"","select_vg_id":""}
After JSON.parse(template);
we have the next:
But when I click to open arrow the private_attachfilephoto field gets empty string:
Why private_attachfilephoto gets empty string ?
Code part:
return new Promise((resolve, reject) => {
var templates = [];
for(var i = 1; i <= 3; i++) {
var template = localStorage.getItem("letter_" + i);
console.log(template);
if(template) {
template = JSON.parse(template);
console.log(template);
templates.push(template);
}
}
console.log(templates);
resolve(templates);
});