Skip to content

Commit

Permalink
feat(adonis-typings/relations.ts): typing support for nullable 1-1 re…
Browse files Browse the repository at this point in the history
…lations (hasOne and belongsTo) (#944)
  • Loading branch information
the-mediocre-dev authored Sep 22, 2023
1 parent 7e01150 commit b7ec9d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions adonis-typings/relations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ declare module '@ioc:Adonis/Lucid/Orm' {
export type HasOneDecorator = <RelatedModel extends LucidModel>(
model: () => RelatedModel,
options?: RelationOptions<HasOne<RelatedModel>>
) => TypedDecorator<HasOne<RelatedModel>>
) => TypedDecorator<HasOne<RelatedModel> | null>

/**
* Decorator signature to define has many relationship
Expand All @@ -115,7 +115,7 @@ declare module '@ioc:Adonis/Lucid/Orm' {
export type BelongsToDecorator = <RelatedModel extends LucidModel>(
model: () => RelatedModel,
options?: RelationOptions<HasOne<RelatedModel>>
) => TypedDecorator<BelongsTo<RelatedModel>>
) => TypedDecorator<BelongsTo<RelatedModel> | null>

/**
* Decorator signature to define many to many relationship
Expand Down

0 comments on commit b7ec9d4

Please sign in to comment.