Created
November 28, 2018 16:22
-
-
Save Eth3rnit3/76ba9b0d13e2cd00d03b08f09b465d68 to your computer and use it in GitHub Desktop.
This file contains hidden or 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; | |
| // // Get workingDays for a given User | |
| User.findByPk(1, {include: ['days']}) | |
| .then((user) => { | |
| console.log(user.get()) | |
| }) | |
| .catch((err) => console.log("Error while searching user : ", err)) | |
| // Get Users for a given WorkingDay | |
| WorkingDay.findByPk(1, {include: ['employes']}) | |
| .then((workingDay) => { | |
| console.log(workingDay.get()) | |
| }) | |
| .catch((err) => console.log("Error while searching workingDay : ", err)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment