function addCompany({ name, addresses, phone, interests, description, image, role, email }) {
  console.log(`Defining company ${name}`);
  createUser(email, role);
  // Define the user in the Meteor accounts package.
  // Create the profile.
  Company.collection.insert({ name, phone, description, image, email, role });
  // Add interests and projects.
  interests.map(interest => CompanyInterest.collection.insert({ name: email, interest }));
  addresses.map(address => CompanyAddress.collection.insert({ name: email, address }));
  // Make sure interests are defined in the Interests collection if they weren't already.
  interests.map(interest => addInterest(interest));
  addresses.map(address => addAddress(address));
}
/** Defines a new user and associated profile. Error if user already exists. */
Defines a new user and associated profile. Error if user already exists.
Defines a new user and associated profile . Error if user already exists .
function addCompany({ name, addresses, phone, interests, description, image, role, email }) {
  console.log(`Defining company ${name}`);
  createUser(email, role);
  Company.collection.insert({ name, phone, description, image, email, role });
  interests.map(interest => CompanyInterest.collection.insert({ name: email, interest }));
  addresses.map(address => CompanyAddress.collection.insert({ name: email, address }));
  interests.map(interest => addInterest(interest));
  addresses.map(address => addAddress(address));
}
function addCompany ( { name , addresses , phone , interests , description , image , role , email } ) { console . log ( ` ${ name } ` ) ; createUser ( email , role ) ; Company . collection . insert ( { name , phone , description , image , email , role } ) ; interests . map ( interest => CompanyInterest . collection . insert ( { name : email , interest } ) ) ; addresses . map ( address => CompanyAddress . collection . insert ( { name : email , address } ) ) ; interests . map ( interest => addInterest ( interest ) ) ; addresses . map ( address => addAddress ( address ) ) ; }
Defines a new user and associated profile.
Defines a new user and associated profile .
// Define the user in the Meteor accounts package. // Create the profile. // Add interests and projects. // Make sure interests are defined in the Interests collection if they weren't already.