I have model called Account_Model.js that contains query to create, read, update and delete (CRUD) user account. I need different constructor (to create and update, I need to pass username, fullname, password etc to the constructor, but when I want to delete user account, I only need to pass username).
var connection = require('../config/db.js');
class Account_Model{
constructor(params){
this.username = params.username,
this.fullname = params.fullname,
this.password = params.password
}
}
getData(){}....
Is this a good practice? Cause when I delete the user, I only pass username in Account_Model instance and left fullname and password null. Thank you