able to save images

This commit is contained in:
Mohammed Ashab Uddin
2020-08-07 09:15:21 +04:00
parent c5329eda93
commit 65c76ac732
3 changed files with 59 additions and 16 deletions

View File

@@ -7,6 +7,7 @@ class Product {
this.desc = desc;
this.cost = cost;
this.image = image;
this.imageUrl = '';
}
/**

View File

@@ -10,6 +10,8 @@ class Website {
this.firstName = '';
this.lastName = '';
this.companyName = companyName;
this.logo = '';
this.banner = '';
this.logoUrl = '';
this.bannerUrl = '';
this.desc = '';
@@ -66,6 +68,27 @@ class Website {
return this.getProduct(this.products.selectedData);
}
toJson(){
let j = {};
j["firstName"] = this.firstName;
j["lastName"] = this.lastName;
j["companyName"] = this.companyName;
j["logoUrl"] = this.logoUrl;
j["bannerUrl"] = this.bannerUrl;
j["email"] = this.email;
j["description"] = this.desc;
let csv = '';
for (let prod of this.products.getAllData().values())
{
let m = [prod.id, prod.name, prod.desc, prod.cost, prod.imageUrl].join(',');
csv += `${m}\n`;
}
j['csv'] = csv;
return JSON.stringify(j);
}
}