Created
November 28, 2018 12:18
-
-
Save Eth3rnit3/2b385d80f68099567fb1a68117c33f6b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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