async function add(user) {
    const [id] = await db("users").insert(user, "id");
    if(user.user_type == "applicant") {
      Applicants.addApplicantProfile(id);
    }else if(user.user_type == "writer") {
      Writers.addWriterProfile(id);
    }

    return findById(id);
}
//function to add a new user
function to add a new user
function to add a new user
async function add(user) {
    const [id] = await db("users").insert(user, "id");
    if(user.user_type == "applicant") {
      Applicants.addApplicantProfile(id);
    }else if(user.user_type == "writer") {
      Writers.addWriterProfile(id);
    }
    return findById(id);
}
async function add ( user ) { const [ id ] = await db ( "users" ) . insert ( user , "id" ) ; if ( user . user_type == "applicant" ) { Applicants . addApplicantProfile ( id ) ; } else if ( user . user_type == "writer" ) { Writers . addWriterProfile ( id ) ; } return findById ( id ) ; }
function to add a new user
function to add a new user