zznicole / shopping-list

Ourshoppinglist is a Mobile-first Web application project. It was created by a team of two developers, using modern Javascript, ES6, React.js,Node.js DBOO database, Material UI, Arios......
0 stars 0 forks source link

Rewrite the class construction code for a number of classes #53

Open kft-a opened 3 years ago

kft-a commented 3 years ago

Some of the classes did not get complete constructors when first written and simply got a constructor with no arguments and a non class function for construction. E.g. the class User has a constructor that takes no arguments and an associated function called newUser() which takes a set of parameters. Remove the function newUser and make the constructor take the same set of arguments. It is very important that all parameters have default values, as the dboo API will construct instances with an empty argument list.

Any associated code in other parts that uses the new function must be changed to do normal construction.

The following classes should be rewritten: class User class UserPassword class Category class Item (but the function createItems is still needed, but rewritten slightly; the function createItem is not needed) class ShoppingList