Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 1f42c79d
authored
Jan 21, 2020
by
Oliver Emery
Committed by
Pedro Augusto de Paula Barbosa
Jan 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(types): fix BelongsToManyGetAssociationsMixinOptions (#11818)
1 parent
365d7c35
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletions
types/lib/associations/belongs-to-many.d.ts
types/test/model.ts
types/lib/associations/belongs-to-many.d.ts
View file @
1f42c79
...
@@ -2,6 +2,7 @@ import {
...
@@ -2,6 +2,7 @@ import {
BulkCreateOptions
,
BulkCreateOptions
,
CreateOptions
,
CreateOptions
,
Filterable
,
Filterable
,
FindAttributeOptions
,
FindOptions
,
FindOptions
,
InstanceDestroyOptions
,
InstanceDestroyOptions
,
InstanceUpdateOptions
,
InstanceUpdateOptions
,
...
@@ -100,6 +101,10 @@ export class BelongsToMany<S extends Model = Model, T extends Model = Model> ext
...
@@ -100,6 +101,10 @@ export class BelongsToMany<S extends Model = Model, T extends Model = Model> ext
*/
*/
export
interface
BelongsToManyGetAssociationsMixinOptions
extends
FindOptions
{
export
interface
BelongsToManyGetAssociationsMixinOptions
extends
FindOptions
{
/**
/**
* A list of the attributes from the join table that you want to select.
*/
joinTableAttributes
?:
FindAttributeOptions
/**
* Apply a scope on the related model, or remove its default scope by passing false.
* Apply a scope on the related model, or remove its default scope by passing false.
*/
*/
scope
?:
string
|
boolean
;
scope
?:
string
|
boolean
;
...
...
types/test/model.ts
View file @
1f42c79
import
{
Association
,
DataTypes
,
HasOne
,
Model
,
Sequelize
}
from
'sequelize'
;
import
{
Association
,
BelongsToManyGetAssociationsMixin
,
DataTypes
,
HasOne
,
Model
,
Sequelize
}
from
'sequelize'
;
class
MyModel
extends
Model
{
class
MyModel
extends
Model
{
public
num
!
:
number
;
public
num
!
:
number
;
...
@@ -103,3 +103,15 @@ UserModel.findCreateFind({
...
@@ -103,3 +103,15 @@ UserModel.findCreateFind({
*/
*/
class
TestModel
extends
Model
{};
class
TestModel
extends
Model
{};
TestModel
.
primaryKeyAttributes
;
TestModel
.
primaryKeyAttributes
;
/**
* Test for joinTableAttributes on BelongsToManyGetAssociationsMixin
*/
class
SomeModel
extends
Model
{
public
getOthers
!
:
BelongsToManyGetAssociationsMixin
<
OtherModel
>
}
const
someInstance
=
new
SomeModel
()
someInstance
.
getOthers
({
joinTableAttributes
:
{
include
:
[
'id'
]
}
})
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment