Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

findOrCreate wrong return types? #79

Closed
havsar opened this issue Dec 4, 2016 · 0 comments
Closed

findOrCreate wrong return types? #79

havsar opened this issue Dec 4, 2016 · 0 comments

Comments

@havsar
Copy link

havsar commented Dec 4, 2016

findOrCreate should return (instance, created) instead of a Model or I'm missing something?

The successful result of the promise will be (instance, created) - Make sure to use .spread()

static findOrCreate(options: FindOrInitializeOptions): Promise<Model>;

So this makes it not possible to use arrays destructuring like let [user, isCreated] = await Models.User.findOrCreate(..)

Edit: Used wrong version of the definition file, needed 3.

@havsar havsar closed this as completed Dec 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant