Skip to content

Instantly share code, notes, and snippets.

@Eth3rnit3
Created November 28, 2018 12:18
Show Gist options
  • Save Eth3rnit3/2b385d80f68099567fb1a68117c33f6b to your computer and use it in GitHub Desktop.
Save Eth3rnit3/2b385d80f68099567fb1a68117c33f6b to your computer and use it in GitHub Desktop.
const models = require('./models');
const User = models.User;
const Company = models.Company;
const WorkingDay = models.WorkingDay;
Company.create({
name: "My super company"
})
.then((newCompany) => {
// The get() function allows you to recover only the DataValues of the object
console.log(newCompany.get())
})
.catch((err) => {
console.log("Error while company creation : ", err)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment