Skip to content
Discussion options

You must be logged in to vote

I solve the issue with the following additions to my relationships in each model

Doc Model

@hasOne(() => User, {
    localKey: 'assigned_to',
    foreignKey: 'id'
  })
  public assignedToUser: HasOne<typeof User>

  @hasOne(() => User, {
    localKey: 'assigned_by',
    foreignKey: 'id'
  })
  public assignedByUser: HasOne<typeof User>

  @hasOne(() => User, {
    localKey: 'approved_by',
    foreignKey: 'id'
  })
  public approvedByUser: HasOne<typeof User>

User Model

@hasMany(() => Doc, {
    foreignKey: 'assigned_to'
  })
  public assignedToDocs: HasMany<typeof Doc>

  @hasMany(() => Doc, {
    foreignKey: 'assigned_by'
  })
  public assignedByDocs: HasMany<typeof Doc>

  @hasMany(() => 

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@WeyIin
Comment options

Answer selected by simonjcarr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants