Did the required changes
This commit is contained in:
@@ -8,6 +8,43 @@ class Product {
|
||||
this.cost = cost;
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Number} id
|
||||
*/
|
||||
setId(id){
|
||||
return this.id = id;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {String} name
|
||||
*/
|
||||
setName(name){
|
||||
return this.name = name;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {String} description
|
||||
*/
|
||||
setDesc(description){
|
||||
return this.desc = description;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {Number} cost
|
||||
*/
|
||||
setCost(cost){
|
||||
return this.cost = cost;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {String} image
|
||||
*/
|
||||
setImage(image){
|
||||
return this.image = image;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports.Product = Product;
|
||||
|
||||
@@ -37,6 +37,14 @@ class Website {
|
||||
return this.products.getData(productId);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {[]}
|
||||
*/
|
||||
getAllProduct(){
|
||||
return this.products.getAllData().values();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} productId
|
||||
|
||||
Reference in New Issue
Block a user