neezzzy / Final-Project-P100

capstone project for the Software Development Certificate
0 stars 1 forks source link

fix function createProjectWithRandomUser to pull only users with userType: company #72

Open mdroidian opened 1 year ago

mdroidian commented 1 year ago

https://github.com/neezzzy/Final-Project-P100/blob/3834eeab9c7223eb5ecd98989ef19a97dc6c3617/client/controllers/adminController.js#L140

pulls all users and selects at random

If statement stops mongoose from trying to create document

would be optimal if function was only grabbing from User users with userType company and selecting a random one from there but that seems to not be the case